How to upgrade/update the sqlite3 version on your Mac

First check to see which version of sqlite3 you want to upgrade to and figure out what the URL for the tar ball is. In this example, I want to upgrade to version 3.6.18
Visit SQLite3 Download Page
Here is one way to do it:

mkdir ~/src
cd ~/src
curl http://www.sqlite.org/sqlite-3.6.18.tar.gz | tar xvfz
cd sqlite-3.6.18
autoconf
./configure –prefix=/usr/local
make
sudo make install

# check what version of SQLite is installed
sqlite3 –version
# 3.6.18

which sqlite3
# /usr/local/bin/sqlite3

VN:F [1.9.22_1171]
Rating: 3.5/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 3 votes)
How to upgrade/update the sqlite3 version on your Mac, 3.5 out of 5 based on 2 ratings
Facebook Twitter Email

8 Comments to “How to upgrade/update the sqlite3 version on your Mac”

  1. Jay 29 July 2014 at 12:31 am #

    You may have encountered a bug in the Ruby interpreter or extension libraries.

    When I run rails server in terminal this error comes up. It was working but after stopping webrick, its now running again.

    any help????????

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Doug 18 February 2013 at 4:03 pm #

    If you use homebrew, these instructions will cause brew doctor to choke as homebrew expects only brews to be in usr/local. With homebrew do the following:

    First you should always:
    brew update
    brew doctor
    brew upgrade

    Then:
    brew install sqlite
    brew link –force sqlite

    The last line is necessary to force homebrew to create the symlinks rather than leaving sqlite as a ‘keg only’ brew. After this brew doctor will always return a warning because it doesn’t like having symlinks to duplicates of programs that are part of the OS X system.

    VA:F [1.9.22_1171]
    Rating: 3.5/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: +2 (from 2 votes)
  3. Doug 18 February 2013 at 3:34 pm #

    @jamini, you should never overwrite the system version as it can break things and it’s completely unnecessary. You may need to edit your path to check /usr/local/bin before /usr/bin

    Note: the above instructions from 2009 are generally correct but slightly outdated, sqlite.org now provides an amalgamation so you should skip the line “autoconf” and you can remove the –prefix= argument as that is the default. You will also need to close and reopen your shell to get the correct return from “sqlite3 –version”.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. RonOnRails 11 May 2011 at 2:11 am #

    There are a couple of gotchas:

    curl http://www.sqlite.org/sqlite-3.6.18.tar.gz | tar xvfz

    delete the f switch otherwise tar expects an argument to follow.

    ./configure –prefix=/usr/local

    The long dash before should be replaced by –(double dash).

    This works:

    mkdir ~/src
    cd ~/src
    curl http://www.sqlite.org/sqlite-3.6.18.tar.gz | tar xvz
    cd sqlite-3.6.18
    autoconf
    ./configure –prefix=/usr/local
    make
    sudo make install

    # check what version of SQLite is installed
    sqlite3 –version
    # 3.6.18

    VA:F [1.9.22_1171]
    Rating: 4.5/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: +2 (from 2 votes)
  5. jamini 4 January 2011 at 3:05 pm #

    Move /usr/local/bin/sqlite3 to /usr/bin/sqlite3

    This will overwrite the old sqlite3 with the new version. The new binary is created in /usr/local/bin since the instructions given here specifies this directory as the prefix.

    VA:F [1.9.22_1171]
    Rating: 3.3/5 (3 votes cast)
    VA:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  6. niblettes 20 October 2010 at 12:35 pm #

    Does this overwrite the system install version of sqlite (3.4.0 on my mac mini)?

    Both –version and which sqlite3 show that after following these steps I’m still running 3.4.0 and its looking to /usr/bin/sqlite3.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  7. navid 19 September 2010 at 8:46 am #

    I’m not sure if this will solve your issue but you may want to look at http://forums.sun.com/thread.jspa?threadID=5327133

    VN:F [1.9.22_1171]
    Rating: 1.0/5 (1 vote cast)
    VN:F [1.9.22_1171]
    Rating: -1 (from 1 vote)
  8. rahulvyas 20 February 2010 at 12:45 am #

    I am getting this error

    curl: (6) Couldn’t resolve host ‘www.sqlite.org’

    gzip: stdin: unexpected end of file
    tar: Child returned status 1
    tar: Error exit delayed from previous errors
    admins-mac-pro:src admin$

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply