Users of Ubuntu who want to use Spatialite for managing GIS layers are in luck. New updated packages have been released bringing to Ubuntu and derivatives all the new feature of spatialite 3.1.0.
The latest spatialite includes the following improved capabilities:
- New functions such as ST_Expand, ST_Reverse, ST_Translate
- Updates to several other functions
- Uses the latest sqlite 3.7.13 with an improvement in rounding double precision numbers
- Uses the recent geos-3.3.2
- An easier format for using a SpatialIndex in a query
To install the suite you will need the ubuntugis-unstable repository. If you haven’t yet added that repo to your software sources, follow the instructions on this OSGeo wiki page
Then it’s just a matter of running:
sudo apt-get install --yes libspatialite spatialite-bin
This will give you the library (probably already installed if you have any GIS software at all on your system), and the CLI binary for working with spatialite data. If you’re a command line type, then you’ve got all you need to start building and querying a spatialite database. You also have the command line tools to import OSM data into a Spatialite database: spatialite_osm_raw, spatialite_osm_filter, etc. And the two utilites shp_doctor to repair shapefiles, and spatialite_tool to import and export data to/from a Spatialite database.
However, the GUI interface is another story. The ready built package is version 1.3 – very old. In fact, if you create a DB using the new CLI program, and add some data layers, it will not open in the ancient ver. 1.3 GUI program. I suggest to take a few minutes to download the sources and manually build your own spatialite_gui. Only a few standard steps in the terminal:
First you’ll need a bunch of development packages:
sudo apt-get install --yes libwxgtk2.8-dev libgeos-dev libgeos++-dev libgeotiff-dev libcairo2-dev libfreexl-dev libspatialite-dev
Now download two source packages, and unzip them in your Downloads directory. First the libgaiagraphics package:
cd ~/Downloads
wget http://www.gaia-gis.it/gaia-sins/libgaiagraphics-0.4b.tar.gz
tar xzf libgaiagraphics-0.4b.tar.gz
cd libgaiagraphics-0.4b
./configure
make
sudo make install-strip
sudo ldconfig
cd ..
Here we download the tarball from the gaia-gis.it website, unzip, then run the usual configure, make and make install commands to compile and put everything in place.
Next the GUI program itself:
wget http://www.gaia-gis.it/gaia-sins/spatialite_gui-1.5.0-stable.tar.gz
tar xzf spatialite_gui-1.5.0-stable.tar.gz
cd spatialite_gui-1.5.0-stable
./configure
make
sudo make install-strip
You might want to add an item to the applications menu, and put the icon into place. While still in the spatialite_gui-1.5.0 directory:
sudo cp gnome_resource/spatialite-gui.desktop /usr/share/applications/
sudo cp gnome_resource/spatialite-gui.png /usr/share/pixmaps/
And off you go collecting and querying spatial data.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
#1 by Brad Hards on 30/06/2012 - 04:39
Just worth a note that this isn’t a formal 3.1.0 based release (since it isn’t released yet).
There will almost certainly be more features in 3.1.0 than are available now.
#2 by Micha Silver on 30/06/2012 - 10:34
Thanks, Brad
I “jumped the gun” because I was pleased to see Ubuntu maintainers making the effort to keep up with you and Sandro in releasing updated packages. The disappointment is the GUI, of course. I have no idea why on Ubuntu they’re stuck at spatialite-gui 1.3.0.
By “more features” are you referring to the improved topology support?
Cheers,
Micha
#3 by Winston Smith on 09/02/2013 - 12:18
Hey, I posted an updated howto for SpatiaLite 4.0.0 and the GUI 1.6.0
http://www.wnstnsmth.net/blog/2013/02/how-to-install-spatialite-and-spatialitegui-on-ubuntu
#4 by Micha Silver on 09/02/2013 - 20:48
Thanks, Winston
I’m holding off for a while with spatialite 4.0 until QGIS catches up. As you know, databases created with 4.0 cannot be opened with earlier versions. And it seems that the built in spatialite provider in QGIS is still based on 3.0, so if you use the newer spatialite to create and populate a database, it will not be usable in QGIS.
#5 by Winston Smith on 15/02/2013 - 16:15
Hey Micha, you’re welcome. I actually DID install QGIS (but I compiled the latest version from source and specified spatialite to be libspatialite-4.0.0 and not to use internal spatialite) and so far it works with 4.0. See this thread for some background information how to do it: I might post a blog article about it somewhere in the future: https://groups.google.com/forum/?fromgroups=#!topic/spatialite-users/vSCXOm9DNOY