Menu

How to Install SQLite on Rocky Linux 9: A Step-by-Step Tutorial

Install the SQLite command-line shell on Rocky Linux 9 with DNF and verify that the sqlite3 client is available.

Posted on By Updated on
On this page

This guide installs the sqlite3 command-line client from Rocky Linux 9’s package repositories. SQLite is an embedded database library and file format; it does not run as a separate database server.

Prerequisites

Before you begin the installation, make sure you have the following:

  1. Rocky Linux 9: Ensure you have a working Rocky Linux 9 installation.
  2. Terminal: Access to the terminal or command line interface with root or sudo privileges.

Now that you have the prerequisites in place, let’s proceed with the installation.

Install the SQLite command-line client

SQLite is available in the Rocky Linux 9 package repository. You can easily install it using the dnf package manager. To do this, run the following command:

sudo dnf install sqlite

The system will prompt you to confirm the installation. Type ‘y’ and press Enter to proceed.

Verify the installation

To verify that SQLite has been successfully installed, you can check the version of SQLite by running the following command:

sqlite3 --version

You should see the installed SQLite version in the output.

Start using SQLite

With SQLite installed, you can start using it right away. To open an interactive SQLite prompt, simply type:

sqlite3 app.db

This opens or creates the persistent app.db file in the current directory, then starts the SQLite shell. Running sqlite3 without a filename opens a temporary in-memory database instead; its data is lost when the shell exits.

The version shown by sqlite3 --version is the Rocky Linux repository build, which may differ from the newest upstream SQLite release. Installing the SQLite client does not require a full system upgrade; schedule operating-system updates separately according to your server’s maintenance policy. For shell commands and options, see the official SQLite command-line shell guide.

Conclusion

You’ve successfully installed SQLite on your Rocky Linux 9 system. You can now use SQLite to create, manage, and query databases for your applications. This lightweight database management system is highly versatile and can be used for a wide range of projects. If you’re new to SQLite, be sure to explore its documentation and tutorials to harness the full power of this powerful database system.

Happy coding!