SQLite is a compact database management system (DBMS) that does not require a server, here we learn the commands to install SQLite 3 on Ubuntu 22.04 Jammy or 22.04 Focal.
Unlike other server and client database servers such as MySQL, SQLite is a file-based relational database management system (RDBMS). It is available free to download and use, written in the C programming language. The best example to understand it, many times smartphone apps use SQLite, such as a browser to store cookies or bookmarks in .sqlite3/.sqlite/.DB file format. A great advantage of this format is that the databases only consist of one file and take up little space. If you want to open an SQLite file, you need a program that is compatible with this format.
That’s is the reason SQLite is a preferable choice of developers for using as embedded database software for local or client storage applications such as web browsers. In short, it offers a small, fast, self-contained, high-reliability, full-featured SQL database engine.
If you have just started developing an application and want to try out SQLite 3 to learn how this file-based database works, then here are the commands to install SQLite 3 on Ubuntu 22.04 or 20.04 LTS Linux systems.
Steps to install SQLite 3 on Ubuntu 22.04 | 20.04 LTS
• A Debian based Linux such as Ubuntu
• Non-root sudo user
• Internet connection for online installation
Apt Update Command
On your command terminal, first, run the system update command to let the system update its existing packages as well as refresh the cache of repositories.
sudo apt update -y
Install SQLite 3 on Ubuntu 22.04 | 20.04 with APT
We don’t need to add any third-party repository to install SQLite 3 on our system. What we have to do is- run the APT package manager command to install this file-based database.
sudo apt install sqlite
Once the installation is completed, we can check what version is exactly we got of the SQLite database on our Ubuntu system using the APT package manager.
Installing SQLite 3 by compiling its source
Those who don’t want to use the APT package manager can compile this file-based database directly using its source code.
Install developer tools
To compile the source of some applications on Linux we need some developer’s tools, to get them we just need to install the Build Essential package.
Build essential is a name for a package that includes the GCC/g++ compilers and libraries and some other utilities required to compile software written in C and C++.
The Gnu Compiler Collection, GCC for short, is a collection of compilers and offers a uniform interface for creating programs in C, C ++, Objective-C, Fortran, Ada, Assembler and Go.
sudo apt install build-essential -y
Download source code
Visit the SQLite Download page and click on the Tar.GZ file available for it.
Unzip the zipped file:
Check the file is available there:
Now, use the given syntax to extract it:
tar xvfz filename.tar.gz
example: Don’t forget to replace sqlite-autoconf-3370200 with your file version.
tar xfvz sqlite-autoconf-3370200.tar.gz
Create a directory to safely place the file under /opt:
sudo mkdir /opt/sqlite3
sudo mv sqlite-autoconf-3370200 /opt/sqlite3 cd /opt/sqlite3
Run configure file to build the code for installation
Install SQLite using the Make command
sudo make install
For further knowledge, the user can visit SQLite Documentation.