Fedora and CentOS container images don’t include the sqlite3 command, and on CentOS the package isn’t called sqlite3. In this article I’ll walk you through installing it with DNF on both, plus the headers you need to compile against SQLite.
TLDR
- Install the shell with
sudo dnf install sqlite. The package is calledsqliteand gives you thesqlite3command. - Check it with
sqlite3 --version. - For C headers (
sqlite3.h), also installsqlite-devel. yumstill works on these systems and runs DNF underneath.
What are you installing?
The sqlite package gives you the sqlite3 command-line shell, where you type SQL against a database file. It’s the same sqlite package on Fedora and on CentOS Stream, but the versions differ: Fedora 44 ships SQLite 3.51.2, while CentOS Stream 9 stays on 3.34.1. The sqlite-devel package adds the header files that compilers need.
Prerequisites
| Requirement | Detail |
|---|---|
| OS | Fedora or CentOS Stream (tested: Fedora Linux 44 and CentOS Stream 9) |
| Access | sudo, or a root shell |
| Network | dnf downloads packages from the distribution’s repositories |
| CentOS Linux 7 | End of life on June 30, 2024, with no more updates (CentOS blog). Move to a supported release before installing anything new. |
How to install SQLite3 on Fedora or CentOS
To test each step on a clean system, I ran it in throwaway Fedora and CentOS Stream containers. They run as root, so the commands below have no sudo; on your machine, put sudo in front of dnf.
Step 1: Confirm SQLite isn’t installed yet
# sqlite3 --version
sh: line 1: sqlite3: command not found
Step 2: Install the sqlite package
On CentOS Stream 9:
# dnf install -y sqlite 2>&1 | grep -E '^(Installed:|Complete!| sqlite)'
Installed:
sqlite-3.34.1-11.el9.aarch64
Complete!
On Fedora 44 the same command ends with Complete!. Fedora’s DNF prints its package list in a different format, and the version check below shows 3.51.2:
# dnf install -y sqlite 2>&1 | grep -E '^(Installed:|Complete!| sqlite)'
Complete!
Step 3: Use sqlite, not sqlite3, as the package name
Fedora treats sqlite3 as another name for the same package:
# dnf install -y sqlite3 2>&1 | grep -E 'Package .* is already installed|No match|Nothing to do' | head -2
Package "sqlite-3.51.2-2.fc44.aarch64" is already installed.
Nothing to do.
CentOS Stream 9 doesn’t:
# dnf install -y sqlite3 2>&1 | grep -E 'Package .* is already installed|No match|Nothing to do' | head -2
No match for argument: sqlite3
Check that it works
Print the version and confirm which package owns the command. On Fedora 44:
# sqlite3 --version | cut -d' ' -f1
3.51.2
# rpm -q sqlite
sqlite-3.51.2-2.fc44.aarch64
# rpm -qf $(command -v sqlite3)
sqlite-3.51.2-2.fc44.aarch64
On CentOS Stream 9:
# sqlite3 --version | cut -d' ' -f1
3.34.1
# rpm -q sqlite
sqlite-3.34.1-11.el9.aarch64
# rpm -qf $(command -v sqlite3)
sqlite-3.34.1-11.el9.aarch64
Then run a quick query against a new database file:
# sqlite3 /root/test.db "CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT); INSERT INTO test (name) VALUES ('working'); SELECT * FROM test;"
1|working
If the version is older than you need, that’s the distribution’s choice. On CentOS Stream 9, dnf info sqlite shows which repository it came from:
# dnf info sqlite 2>/dev/null | grep -E '^(Name|Version|From repo|Repository) '
Name : sqlite
Version : 3.34.1
Repository : @System
From repo : appstream
Install the development headers
Programs that compile against SQLite need sqlite3.h, which the sqlite package doesn’t include:
# ls /usr/include/sqlite3.h
ls: cannot access '/usr/include/sqlite3.h': No such file or directory
Install sqlite-devel, and the header appears:
# dnf install -y sqlite-devel 2>&1 | grep -E '^Complete!'
Complete!
# ls /usr/include/sqlite3.h
/usr/include/sqlite3.h
yum or dnf?
Both work. On these systems, yum is a link to DNF. On CentOS Stream 9:
# yum --version | head -1
4.14.0
# readlink -f $(command -v yum)
/usr/bin/dnf-3
On Fedora 44:
# yum --version | head -1
dnf5 version 5.4.3.0
# readlink -f $(command -v yum)
/usr/bin/dnf5
So yum install sqlite and dnf install sqlite do the same thing. On CentOS, yum install sqlite3 fails for the same reason as with dnf.
Troubleshooting
No match for argument: sqlite3: use the package namesqlite.sqlite3.h: No such file or directorywhen compiling: installsqlite-devel.unable to open database file: you can’t write to that folder, or it doesn’t exist. Create the database in a folder you own. See unable to open database file.- Repositories fail on CentOS Linux 7: it’s past end of life, and its packages moved to the vault archive (CentOS blog).
Conclusion
On Fedora and CentOS Stream, dnf install sqlite is all you need for the sqlite3 shell, and sqlite-devel adds the headers. Fedora gives you a recent SQLite; CentOS Stream gives you an older, stable one.
Further reading
- SQLite installation on every platform
- Install SQLite3 on Ubuntu
- SQLite commands
- SQLite create database
Tested with SQLite 3.51.2 on Fedora Linux 44 and SQLite 3.34.1 on CentOS Stream 9 (containers) on 7 October 2026.
