Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the annoying SQLite header and source version mismatch problem when trying to run SQLite3 on Ubuntu 13.04. I've done in various orders (and all multiple times):

  • apt-get remove sqlite3 libsqlite3-dev, and reinstallation
  • ldconfig
  • Compiled sqlite from source using the autoconf tar.gz
  • Tried everything I've found on Google...

Yet I can't figure out what's wrong. I've wasted 3 hours of my life on this!

And in fact, why does the following happen:

$ sqlite3
SQLite header and source version mismatch
2010-03-09 19:31:43 4ae453ea7be69018d8c16eb8dabe05617397dc4d
2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
$ apt-get remove sqlite3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'sqlite3' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

If sqlite3 isn't installed, how can it think there's a mismatch?!


Right, thanks to Aaron, I've now got as far as

$ locate

I've moved them to a temp dir, and now get

$ sqlite3
The program 'sqlite3' is currently not installed. You can install it by typing:
sudo apt-get install sqlite3

I did

$ apt-get install sqlite3
$ apt-get install libsqlite3-dev

And STILL get the same mismatch error

And I've removed the spurious sqlite3.h and sqlite3ext.h files that were still around, repeated everything, and still get the issues...

share|improve this question
If sqlite3 wasn't installed, invoking it on the command line would fail. Presumably there's a copy still installed somewhere, perhaps left over from your manual installation attempt; remove that, confirm that updatedb; locate doesn't find anything except in your build directories, then reinstall via apt-get. – Aaron Miller Aug 12 '13 at 20:16
I've updated the question – ChrisW Aug 12 '13 at 20:33
Sorry, I should've mentioned the header files as well; see if you've got libsqlite3.h hanging around somewhere, and likewise move them to a temporary directory. (It may be that apt won't overwrite those files when installing libsqlite3-dev.) – Aaron Miller Aug 12 '13 at 20:35
Yeh, I've done that too and still get the issue :/ – ChrisW Aug 12 '13 at 20:47
I wish I knew what else to suggest. – Aaron Miller Aug 12 '13 at 21:00
up vote 1 down vote accepted

More background: I was trying to install SQLite3 because when I ran any SVN command, I got an error:

E200029: Couldn't perform atomic initialization 
E200030: SQLite compiled for, but running with 3.6.23

I assumed that fixing my install of SQLite would fix that. However, I think the main issue is that Ubuntu 13.04 requires SQLite 3.6.23, and that is the reason why running

apt-get purge libsqlite3-0 

deletes most of Ubuntu (see this related answer for further details).

After lots of headbanging, shouting, and crying, I decided to try to install SVN from source (as opposed to SQLite, which is what I said I'd done in my question). This was actually relatively straightforward, albeit a little time-consuming.


tar xjvf subversion-1.8.1.tar.bz2

I then found out I needed the APR and APR-utils libraries, so:


tar xjvf apr-1.4.8.tar.bz2
cd apr-1.4.8
sudo make install
cd ..
tar xjvf apr-util-1.5.2.tar.bz2
cd apr-util-1.5.2
./configure --with-apr=/usr/local/apr
sudo make install

...and the serf library (I didn't compile with this the 1st time, but this provides http support - without it SVN can only handle file and svn protocols)..:

tar xjvf serf-1.3.0.tar.bz2
scons APR=/usr/local/apr APU=/usr/local/apr
sudo scons install
scons -c

These are the same commands as in the serf README (if scons isn't installed it's available via apt-get).

SVN also wants the SQLite amalgamation .c file, so download the amalagation and untar it for now - I created a ~/sqlite-amalgamation folder and left everything here. You should then be ready to compile svn. Serf should have installed to a standard place, so doesn't need a location specified

sudo ./configure --with-sqlite=/home/chris/sqlite-amalgamation/sqlite3.c --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-serf
sudo make install

and hopefully that's it. I had SVN error of

The working copy needs to be upgraded

but when I tried svn upgrade I got a SVN database error... the only way round it was to checkout a new version into a new location. But, SVN now works!

It doesn't fix the underlying SQLite3 issue, and I still get the same header / source version mismatch error when doing $ sqlite3, but since I don't need to use standalone SQLite at the moment, that problem can wait until another day (or, is it infact something that should be registered as a bug with Ubuntu?)

share|improve this answer
Glad to know you found your way around it! I'll admit, I've been leery of the "build it yourself" distros like Slackware and Gentoo, but between this and the travails I've endured in my (ultimately successful) effort to set up a Linux VM to host Emacs on my Windows machine at home, I'm strongly tempted to give them another look with fresh eyes. – Aaron Miller Aug 13 '13 at 14:18

I just replaced older version of SQlite library @ location


with newer version which is @ location


Now latest sqlite version

$ sqlite3 --version 
3.8.2 2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d
share|improve this answer
This didn't work for me. I still get 'version mismatch' – Jonathan Hartley Feb 21 '14 at 13:33

This solved my case, linux comes with an older version of sqlite this is why its bringing this problem, do this to sort it out.

  1. mv /usr/lib/i386-linux-gnu/ /usr/lib/i386-linuxgnu/

  2. mv /usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/

         And then copy the database was compiled in Autoconf packets in the past:

        1. cd /usr/local/lib

        2. cp /usr/lib/i386-linux-gnu

       3. cp /usr/lib/i386-linux-gnu

This problem was solved. you will need to run with sudo.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.