Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to upgrade sqlite on Amazon EC2

I need SQLite minimum version 3.8 to support a MediaWiki install on Amazon EC2. Amazon Linux is based on CentOS and the latest version available in the yum repository is SQLite 3.7.17.

The downloads available from sqlite.org bizarrely don't include 64-bit Linux. There is a github repo here that has a prebuilt 64-bit version, however when I download and unzip it, it's only the command line version of SQLite. I put it at /usr/bin:

$ which sqlite3
/usr/bin/sqlite3
$ sqlite3 --version
sqlite3: /lib64/libtinfo.so.5: no version information available (required by sqlite3)
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9

But my MediaWiki install still complains that I have SQLite 3.7.17 installed. When I write a PHP one-liner to test it myself, I get:

$ cat x.php

<?php
print_r(SQLite3::version());
?>

Run it:

$ php7 x.php

Array
(
    [versionString] => 3.7.17
    [versionNumber] => 3007017
)

I am guessing this is because of these libraries:

$ sudo find / -name "libsqlite*"
/usr/lib64/libsqlite3.so.0
/usr/lib64/libsqlite3.so.0.8.6

How can I download / rebuild / or otherwise install a later version of these SQLite3 libraries?

like image 258
Peter Swords Avatar asked Jul 26 '19 07:07

Peter Swords


People also ask

Can you use SQLite on AWS?

To setup and install SQLite server on any of the cloud platforms (Azure, AWS, Google GCP), the best way is to use the SQLite server image from the cloud marketplaces.

Which command is used to install software packages in EC2?

Use the yum install package command, replacing package with the name of the software to install.


1 Answers

The easiest option I found was to build it myself. Tested on Amazon Linux release 2 (Karoo).

  1. Download the latest source code with the configure script from here. Currently this is:
    curl https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz | tar xzf -

  2. Go into the created directory and create the Makefile with our system dependant options:
    cd ./sqlite-autoconf-3320300 && ./configure

  3. Build the binary
    make

  4. Install it
    sudo make install

  5. Clean up
    cd .. && rm -r ./sqlite-autoconf-3320300

Note: It's far from ideal to do this without a proper RPM package. If you update sqlite through yum, you will overwrite you manually built version.

like image 83
halbgut Avatar answered Oct 05 '22 13:10

halbgut