How to Install SQLite on Rocky Linux 8 with DNF
Install the sqlite3 command-line client on Rocky Linux 8 with DNF, verify its version, and create a persistent database file.
On this page
This guide installs the SQLite command-line client (sqlite3) from the Rocky Linux 8 package repositories. SQLite is an embedded database library and file format; it does not run as a separate database server.
Prerequisites
- A working Rocky Linux 8 system.
- A terminal account with
sudoprivileges, or root access.
A full operating-system upgrade is not required just to install SQLite. Apply system updates separately according to your server’s maintenance policy.
Install the SQLite command-line client
Use DNF to install the package:
sudo dnf install sqlite
DNF will resolve the package and its dependencies from the repositories configured for your system. If it cannot find sqlite, check the enabled repositories with dnf repolist and use the distribution’s package-management documentation; avoid downloading an arbitrary RPM from a third-party site.
Verify the installation
Check the version provided by your distribution:
sqlite3 --version
Distribution packages may stay on a supported release branch and receive backported fixes, so this version does not necessarily match the newest upstream SQLite release.
Open a persistent database file
Pass a filename to the SQLite shell to open or create a database file:
sqlite3 app.db
This opens or creates app.db in the current directory. The file persists after the shell exits. If you start sqlite3 without a filename, it opens a temporary in-memory database that is deleted when the session ends. Enter .quit to leave the interactive shell. See the official SQLite command-line shell guide.
The sqlite package installs the command-line shell and runtime. If you are compiling a C or C++ program against SQLite, install the distribution’s development package as well (named sqlite-devel on Rocky Linux 8). For SQL syntax and functions, browse the SQLite reference.