SQLite is a free, lightweight relational database management system (RDBMS) in a C library. SQLite is not a client-server database engine. Instead, it is embedded into the end program. Primarily all programming languages support SQLite, which how languages embed the program is with a file with .sqlite3/.sqlite/.DB extension. The software is a popular choice for local/client storage such as web browsers, Android devices, and much more. The list is quite extensive.
In the following tutorial, you will learn how to install SQLite 3 with Fedora 35 Workstation or Server.
Table of Contents
- Recommended OS: Fedora Linux 35.
- User account: A user account with sudo or root access.
Update Operating System
Update your Fedora operating system to make sure all existing packages are up to date:
sudo dnf upgrade --refresh -y
The tutorial will be using the sudo command and assuming you have sudo status.
To verify sudo status on your account:
Example output showing sudo status:
[joshua@fedora ~]$ sudo whoami root
To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.
To use the root account, use the following command with the root password to log in.
Option 1. Install SQLite 3 on Fedora with DNF
The first option recommended to start with is to install SQLite 3 from the default DNF repository. Given that Fedora focuses on the latest packages, this version is typically updated with the newest version available.
To begin the installation, use the following command in your terminal.
sudo dnf install sqlite
Type Y, then press the ENTER KEY to proceed with the installation.
Next, verify the version installed of SQLite 3 with the –version command.
Option 2. Install SQLite 3 on Fedora by Compiling Source
An alternative option for users that would like to install SQLite manually is to compile the source. Given that Fedora focuses on the latest packages, sometimes you may want to install the nightly build or even an older version for specific purposes.
First, install the dependencies below using the following command.
sudo dnf install make automake cmake gcc libtool-ltdl-devel
Type Y, then press the ENTER KEY to proceed.
Next, visit the SQLite Download page, grab the latest version link, and download it using the wget command.
Extract the files to that directory you just created.
tar xvfz sqlite-autoconf-3370200.tar.gz
Move the file to the directory created earlier.
sudo mv sqlite-autoconf-3370200 /opt/sqlite3
Now, you will navigate to the folder to begin compiling SQLite.
Begin the compiling process using the following command.
The following process uses the (make) command to start the build process. A better way to do this is to specify the number of cores you want to use in compiling to speed up the process.
make -j 2
Note, the (-j) corresponds to the number of cores in your system to speed up the build time. If you have a powerful server, you can set this as high as possible. If you don’t, it will be the default option of 1. To find out how many cores you have on your system, execute the following code:
As you can see, we have two cores, so in the (make) command, we used (-j 2). However, if you have 12 cores, you could have -j 6 cores and dedicate half or more to the process.
Once the build process is complete, begin the installation using the following command.
sudo make install
Once installed, verify the installation and the version number.
As above, the version is 3.37, whereas the Fedora repository version is at 3.36 at the time of this tutorial.
Comments and Conclusion
The tutorial has shown how to install SQLite 3 using the DNF method or compiling from source with Fedora 35. Overall, SQLite 3 is basic but powerful. However, it is acceptable for small to medium websites for large growing sites to look at MariaDB, MongoDB, and PostgreSQL, among many other options.
For more information on building applications with SQLite, visit the official documentation page.