This annoying issue occurs because libgdal was forked between libgdal1 and libgdal1h last year. Ubuntu GIS stable uses libgdal or libgdal1, Ubuntugis unstable uses libgdal1h.
GDAL is a translator library for raster geospatial data formats.
As a library, it presents a single abstract data model to the
calling application for all supported formats. The related OGR
library (which lives within the GDAL source tree) provides
a similar capability for simple features vector data.
You will have to start from fresh.
Make sure you uninstall all software remnants of Ubuntugis Stable / Unstable. Uninstalling libgdal, libgdal1, libgdal1h will remove all software that depends on it. Then check your repos, make sure Ubuntugis Stable & Unstable isn't there.
Then add these repos for QGIS 2.2, Saga 2.1 and Postgres 9.3.3 & PostGIS 2.1.1.
http://www.qgis.org/en/site/forusers/alldownloads.html#ubuntu
Johan Van de Wauw's saga-gis repository
https://wiki.postgresql.org/wiki/Apt
I usually install QGIS first then SAGA, Grass, PostgreSQL 9.3.3, PostGIS 2.1.1, postgresql-contrib-9.3 and finally pgAdmin3.
There are a few small issues. This will install Grass 6.4.3-2, which might not work from Processing in QGIS 2.2. Grass 6.4.3-3, provided by Ubuntugis Unstable, is supposed to fix the problem (but did not work for me on Ubuntu 13.10).
Also, only Ubuntu GIS Unstable provides pgRouting as far as I know (with PostgreSQL 9.1 & PostGIS 2.1.0). If you want pgRouting you will have to compile it from source, it only takes few minutes. If Configure complain that Postgresql-9.1 is not installed, install postgresql-server-dev-9.1 and try again.
From a clean Ubuntu 12.04 Precise install I was able to get it to work with this:
echo 'deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main' | sudo tee -a /etc/apt/sources.list
echo 'deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main' | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 314DF160
sudo apt-get update
sudo apt-get install -y postgresql-server-dev-9.1 postgis python-mapscript python-gdal
For more up-to-date gis packages use the unstable repository
echo 'deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu precise main' | sudo tee -a /etc/apt/sources.list
echo 'deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu precise main' | sudo tee -a /etc/apt/sources.list
This also works for Ubuntu 14.04 Trusty, just replace precise
with trusty
when adding the ubuntugis repos. Then you can also install postgres 9.3 instead of 9.1. So on Trusty use:
sudo apt-get install -y postgresql-server-dev-9.3 postgis python-mapscript python-gdal
The two references for installing this I used were
http://trac.osgeo.org/ubuntugis/wiki/UbuntuGISRepository
https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa/
Also, if you want to use the postgis raster driver through mapscript, it is worth trying to install the latest GDAL version, as it has essential improvements on the raster driver (its much faster and more stable). So in that case I would recommend the unstable repo, in my work so far I did not run into problems due to the "unstable" name.
Best Answer
You can use ubuntugis ppa, which contains everything you need:
The system will take care after the necessary dependencies
Your problem also suggests that you have broken dependencies for qgis. One way to fix this is to clean your cache by running in terminal (you can open the terminal in gnome with
alt + ctrl + T
)or
and then ask apt to try and correct any broken dependencies:
if the output is similar to :
it means that you need some additional packages that you weren't informed about. To install them run: