Search code examples
sqlitecentos7proj

Compile sqlite3-devel 3.35.4 on CentOS 7


I am trying to upgrade my sqlite3-devel to 3.35.4. I can download and install the sqlite binary for the standard sqlite3 program but I cannot find a way to get the development version of sqlite3 version 3.35.4.

I need to update Proj to Proj8 which requires sqlite3 => 3.11

CentOS repos only support sqlite3 3.7.17.

How can I get sqlite3 3.35.4 "dev" or "devel" installed on CentOS 7?


Solution

  • First install gcc and wget:

    sudo yum install gcc wget
    

    Then have a read at Where can one find source archives of old SQLite versions? to find out how to download a specific version of SQLite in .zip format.

    Try the .tar.gz archive for Linux (I think the .zip is for Windows).

    So for your version 3.35.4, the .tar.gz download link will be at: https://www.sqlite.org/2021/sqlite-autoconf-3350400.tar.gz

    The file naming convention of the above path was from looking at the latest .tar.gz download link from https://www.sqlite.org/download.html.

    Download the .tar.gz archive:

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

    Extract it:

    tar -xvf sqlite-autoconf-3350400.tar.gz
    

    Make a build directory and change directory to it:

    mkdir build
    cd build
    

    Run the configure script

    ../sqlite-autoconf-3350400/configure
    

    Compile:

    make
    

    Install it:

    sudo make install
    

    Read carefully the output as it'll tell you where it installs to.

    Confirm the version:

    $ grep Version /usr/local/lib/pkgconfig/sqlite3.pc
    Version: 3.35.4