I am trying to install PostGIS on Ubuntu 12.04 and I think everything is installed correctly except for postgresql. I followed this post. I get the following error and nothing I do seems to satisfy the unmet dependency.

dpkg: error processing /var/cache/apt/archives/postgresql-9.1-postgis_2.0.1-2~precise3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/postgresql/9.1/lib/rtpostgis-2.0.so', which is also in package postgresql-9.1-postgis2 2.0.0-1ubuntu1~ppa18~precise1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

A little help for this ubuntu/gis novice.

  • Do you really need Postgres 9.2?
    – R.K.
    Commented Jan 18, 2013 at 2:23
  • 1
    Is your PostgreSQL 9.2 64bits version? Because if PostGIS is 32bits version, maybe they don't "match". Few years ago I faced a weird and similar problem and finally it was that my PostgreSQL was 64 and PostGIS (in that moment it was 1.3.3 or 1.3.5 version) could not work over this version. I just switched Postgre to 32 bits.
    – Irene
    Commented Jan 18, 2013 at 10:10
  • 1
    First, thank you for the edit, I couldn't figure out why the error code split like that and I got frustrated trying to correct it. I am not sure what I need. I have been reading posts about PostGIS and thought I would install so that I can start learning and play with it. Any correction for installation would be greatly appreciated.
    – LandArch
    Commented Jan 18, 2013 at 16:40

1 Answer 1


Sharpie is alright, but recently UbuntuGis team came in with some stable packages: https://launchpad.net/~ubuntugis/+archive/ppa?field.series_filter=precise, try them.

apt-add-repository deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main 
apt-add-repository deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main
apt-get install postgis

Also, http://postgis.net/source has a good build manual, till today I used it more often than package installation.

  • 1
    This method also requires adding the repo key or you'll get a warning and possible a fail that the repo can't be authenticated. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 314DF160 OR use the ppa method Commented Jul 29, 2013 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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