How can I install or upgrade to sqlite 3.33.0 on Ubuntu 18.04?
Asked Answered
B

1

14

I'm currently running Ubuntu 18.04 with SQLite3. SQLite 3 is at version 3.22.0 and I need to upgrade it to version 3.33.0 to take advantage of new functionality that is available. If I remove and reinstall SQLite3 with apt-get, it just re=installs 3.22.0. How can I upgrade to the latest version of SQLite3?

Bornu answered 16/11, 2020 at 15:58 Comment(2)
Just download and compile the source. It installs into /usr/local by default and tends to just work with anything using the sqlite dynamic library.Thousandth
If you're still using 18.04 in 2023: askubuntu.com/a/1352404/20688Viveca
H
30

I have tried to compile the latest sqlite3 from source and it does not work with the packages of Ubuntu 18.04.

Eventually, I upgraded my Ubuntu to 20.04(Focal Fossa), and it comes with Sqlite 3.31.

If you want the latest Sqlite 3.34(at the time of this post), you need to download and build it yourself.

The steps are pretty straight forward.

Step 1 - Download the Source code

wget https://sqlite.org/2021/sqlite-autoconf-3340100.tar.gz

Step 2 - Extract the tarball

tar -xvf sqlite-autoconf-3340100.tar.gz && cd sqlite-autoconf-3340100

Step 3 - Configure

sudo apt-get install libreadline-dev
./configure

Step 4 - Make

make

Step 4.5 - Get rid of the old version

sudo apt-get purge sqlite3

Step 5 - Make Install

sudo make install

Step 6 - Add to path

export PATH="/usr/local/bin:$PATH"  # also add in your .bashrc

Step 7 - Verify the installation

sqlite3 --version
3.34.1 2021-01-20 14:10:07 10e20c0b43500cfb9bbc0eaa061c57514f715d87238f4d835880cd846b9ebd1f
Headstrong answered 15/2, 2021 at 23:57 Comment(5)
I tried your steps above to the letter, but step 6 does not work: "-bash: /usr/bin/sqlite3: No such file or directory". Can I only reach sqlite3 in its own folder?Alaynaalayne
You are building on Ubuntu 20.04?Headstrong
Yes. Someone else with more Linux knowledge helped me, apparently the folder where sqlite3 gets installed is not part of the PATH, so it had to be added manually.Alaynaalayne
Can you add that to the answer so that if somebody faces a similar situation, they have that note for reference.Headstrong
On Ubuntu 20.04.6 LTS (Focal Fossa), it needs to instead be : export PATH="/usr/local/lib:$PATH" # also add in your .bashrcBari

© 2022 - 2024 — McMap. All rights reserved.