SQLite is one of the Relational C-library DBMS(Database Management System). SQLite is not a client-server Database Engine as opposed to several other Database Management Systems. SQLite is a common pick in application software, such as web browsers,as a local/client storage integrated Database System. It is probably the most frequently used database engine because it is used by many widely known browsers, Operating Systems, mobile applications and embedded systems today. SQLite records the whole database on a host system as a single platform file.
File-based is SQLite. It is not the same as other SQL Databases because SQLite has no separate server process, as is the case with most other SQL databases. Installation process of SQLite on Debian 11(Linux OS) by Two methods is explained in the Article:
- How to install SQLite from Debian Repository
- How to Install SQLite using SQLite website
Before installation of SQLite from any of the one method update the packages:
It is important to ensure your system is up-to-date before installation of any software by running the below mentioned command:
Now to get latest version of all installed packages on your system, upgrade your packages by running below mentioned command:
Now all my packages are updated and upgraded.
Method 1: How to install SQLite from Debian Repository
As SQLite is already present in the Debian 11 repository, we can easily install the SQLite from the repository but that is not the latest version of SQLite.
Step1: Installing SQLite on Debian 11
Run the below mentioned command to install the available version of SQLite from Debian 11 repository:
Step2: Checking Version
To verify the installation, check version number of SQLite by below mentioned command:
Method 2: How to Install SQLite using SQLite website
The latest stable version of SQLite at the time of writing this article is “3.36.0” but unfortunately in Debian 11 repository, the latest version is not available. So to install the latest version directly from SQLite web page we will use wget and tar command.
Follow the steps below to successfully install the latest version:
Step 1: Installing build tools
First we need to install the build tools for construction of package, run the below mentioned command to install “build-essentials”:
Step2: Getting SQLite Source code
To install SQLite source code, go to SQLite website, check for the latest version or any version you want to install and copy its source code link; in my case the latest is 3.36.0. Now download it using below mentioned command:
You can replace SQLite source code link if you are installing some other version in wget command.
Step3: Extracting the Source code
Run the below mentioned command to create a separate directory to extract the source code in that folder:
You can set the name of directory according to your choice:
Now move to newly created directory by below mentioned command:
Now extract the source code of SQLite by tar command:
Step4: Compiling Source code of SQLite
To compile extracted source code first you need to get access to generated folder by below mentioned command:
To start compiling, configure the code by below mentioned command:
Now use the make command to build libraries and executable files from source code of SQLite:
Step5: Installing SQLite
Now install the sqlite 3.36.0 version with the help of the make command by running below mentioned command:
Step6: Verifying Installation
To verify the installation of latest version of SQLite, check the version number by below mentioned command:
How to test SQLite
After successful installation of SQLite, you can create a database and table to test its working.
Create Database “linuxhint.db” with help of sqlite3 command as mentioned below:
Now create the table “linux” with parameters (name String,version INT) by below mentioned code:
Insert data in to newly created table:
Now get data from “linux” table by below mentioned query:
You can write more queries according to your requirement; this was just a sample to show you how SQLite works in Debian 11 terminal.
SQLite is a file-based relational Database, it contains C-library. It is a commonly used Database Engine mostly used in mobile applications. It records the whole Database on a host system as a single platform file. In this article we have discussed the installation of SQLite on Debian 11 by two methods; from Debian 11 repository and by SQLite website using wget command. Also the working of SQLite using sqlite3 command on terminal is discussed. After reading this article you will be able to successfully install and use SQLite on your Debian 11 system.