How To Install SQLite on Fedora 40
In this tutorial, we will show you how to install SQLite on Fedora 40. SQLite is an embedded, serverless database engine that offers a lightweight yet powerful solution for data storage and management. Unlike traditional client-server database systems, SQLite operates as a self-contained library that can be easily integrated into applications.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of SQLite on Fedora 40.
Prerequisites
Before we dive into the installation process, ensure that you have the following prerequisites in place:
- A server running one of the following operating systems: Fedora 40.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. Fedora provides the Terminal application for this purpose. It can be found in your Applications menu.
- A stable internet connection to download the necessary packages.
- A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install SQLite on Fedora 40
Step 1. Update the System.
To begin, make sure your Fedora 40 installation is up to date with the latest security patches, bug fixes, and software updates. Open a terminal and run the following command:
sudo dnf clean all sudo dnf update
This command will fetch the latest package information from the Fedora repositories and prompt you to install any available updates. Review the list of updates and confirm the installation by typing “y” when prompted.
Step 2. Installing SQLite.
- Method 1: Using DNF Package Manager
The easiest and most straightforward way to install SQLite on Fedora 40 is by using the built-in DNF package manager. Follow these step-by-step instructions:
sudo dnf install sqlite
DNF will resolve any dependencies and prompt you for confirmation. Press “y” and hit Enter to proceed with the installation.
Once the installation is complete, verify it by checking the SQLite version:
sqlite3 --version
- Method 2: Manual Installation from Source
If you require a specific version of SQLite or want more control over the installation process, you can compile and install SQLite from the source code. Follow these steps:
Install the necessary development tools and libraries:
sudo dnf install gcc make autoconf automake libtool
Download the SQLite source code from the official website:
wget https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz
Extract the downloaded archive:
tar xvzf sqlite-autoconf-3460100.tar.gz
Change into the extracted directory:
cd sqlite-autoconf-3410200
Configure the build:
./configure --prefix=/usr/local
Compile the source code:
make
Install SQLite:
sudo make install
Create symbolic links for the SQLite executable and library:
sudo ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3 sudo ln -s /usr/local/lib/libsqlite3.so.0 /usr/lib/libsqlite3.so.0
Verify the installation:
sqlite3 --version
- Method 3: Using GUI Tools
For users who prefer a graphical interface to manage SQLite databases, Fedora 40 offers the SQLite Browser tool. To install SQLite Browser, follow these steps:
sudo dnf install sqlitebrowser
Launch SQLite Browser from the application menu or by running the following command in the terminal:
sqlitebrowser
SQLite Browser provides a user-friendly interface for creating, editing, and querying SQLite databases, making it a valuable tool for both beginners and experienced users.
Step 3. Basic SQLite Operations on Fedora 40.
Now that you have SQLite installed on your Fedora 40 system, let’s explore some basic operations to get you started.
Start the SQLite command-line interface:
sqlite3
Create a new database:
.open mydb.sqlite
This command creates a new SQLite database file named mydb.sqlite
in the current directory.
Create a table:
CREATE TABLE users ( id INTEGER PRIMARY KEY, name TEXT, email TEXT );
This command creates a table named users with three columns: id
, name
, and email
.
Insert data into the table:
INSERT INTO users (name, email) VALUES ('John Doe', 'nadiashela@example.com');
Query data from the table:
SELECT * FROM users;
Exit the SQLite command-line interface:
.exit
Congratulations! You have successfully installed SQLite. Thanks for using this tutorial for installing SQLite on Fedora 40 system. For additional help or useful information, we recommend you check the SQLite website.