EF CORE — PREPARING UBUNTU FOR SQLITE
ENTITY FRAMEWORK CORE (EF CORE) — PART 0: PREPARING UBUNTU FOR SQLITE
This preliminary tutorial prepares Ubuntu for the EF Core SQLite series before the dotnetef project is created. The same commands apply to Ubuntu flavours such as Xubuntu, Kubuntu and Lubuntu.
1. Check the Ubuntu environment
Confirm the processor architecture and glibc version:
uname -m
ldd --version
A 64-bit Intel or AMD computer normally reports:
x86_64
Ubuntu 20.04 and its flavours commonly provide glibc 2.31. Some bundled e_sqlite3 native binaries require GLIBC_2.33 and cannot load on that environment.
Do not manually replace or upgrade glibc. It is a core operating-system component. This series will use Ubuntu's system SQLite library instead.
2. Install SQLite before creating the project
sudo apt update
sudo apt install sqlite3 libsqlite3-0 libsqlite3-dev
When prompted to continue, enter Y.
| Package | Purpose |
|---|---|
sqlite3 | SQLite command-line program |
libsqlite3-0 | Runtime SQLite shared library |
libsqlite3-dev | Development link and header files |
Verify the installation:
sqlite3 --version
ldconfig -p | grep libsqlite3
The output should include a SQLite version and a library path similar to:
libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0
Troubleshooting
| Problem | Remedy |
|---|---|
sqlite3: command not found | Run the APT installation command above |
No libsqlite3 result | Confirm that libsqlite3-0 and libsqlite3-dev were installed |
GLIBC_2.33 not found | Use the system-SQLite packages described in PART 1 |
PART 0 complete: Ubuntu now has the SQLite command-line program and system shared library required by the EF Core tutorial.
Next: ENTITY FRAMEWORK CORE (EF CORE) — PART 1 verifies .NET 8, creates dotnetef, configures EF Core with system SQLite, and creates the first database.