CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 20:40:19 GMT
server: Fly/6f91d33b9d (2025-10-08)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K7AG1FS02HDG3J60Y8A1PV2V-bom
Compile a new sqlite3 binary on Ubuntu | Simon Willison’s TILs
Compile a new sqlite3 binary on Ubuntu
I wanted to try the vacuum into
backup command that was released in SQLite3 3.27.0 on 2019-02-07.
Ubuntu 18.04.4 LTS has SQLite 3.22.0 from 2018-01-22.
Thankfully it's really easy to compile a new sqlite3
binary on Ubuntu, using the amalgamation release.
cd /tmp
wget https://www.sqlite.org/2020/sqlite-amalgamation-3310100.zip
unzip sqlite-amalgamation-3310100.zip
cd sqlite-amalgamation-3310100
gcc shell.c sqlite3.c -lpthread -ldl
./a.out --version
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6
Now you can move the a.out
file somewhere else:
mkdir ~/bin
mv ./a.out ~/bin/sqlite3
I used the backup command like this:
/home/simon/bin/sqlite3 data.db "vacuum into '/tmp/backup.db'"
Related
- sqlite Compile and run a new SQLite version with the existing sqlite3 Python library on macOS - 2023-08-22
- sqlite Compiling and running sqlite3-rsync - 2024-10-04
- sqlite Building a specific version of SQLite with pysqlite on macOS/Linux - 2021-08-14
- sqlite Compiling the SQLite spellfix.c module on macOS - 2020-09-19
- sqlite Saving an in-memory SQLite database to a file in Python - 2023-04-08
- sqlite Using LD_PRELOAD to run any version of SQLite with Python - 2020-06-17
- sqlite SQLite VACUUM: database or disk is full - 2022-08-29
- homebrew Running the latest SQLite in Datasette using Homebrew - 2022-02-28
- sqlite Copy tables between SQLite databases - 2023-04-03
- sqlite Trying out cr-sqlite on macOS - 2023-09-12
Created 2020-04-30T10:40:20-07:00, updated 2020-09-02T13:33:03-07:00 · History · Edit