Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install postgis on Ubuntu 13.04. I've attempted to follow a number of different blogs and wikis on line, but always run in to the same problem...

$sudo apt-get install postgis postgresql-9.1-postgis
....
Package postgresql-9.2-postgis is not available, but is referred to by another
package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'postgresql-9.2-postgis' has no installation candidate

So I try 9.1...

$sudo apt-get install postgis postgresql-9.1-postgis
....
The following packages have unmet dependencies:
postgresql-9.1-postgis : Depends: postgresql-9.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

No luck, so I go looking for postgresql-9.1...

sudo apt-get install postgresql-9.1
...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-9.1 : Depends: postgresql-common (>= 115~) but it is not going to be
 installed
E: Unable to correct problems, you have held broken packages.

So postgresql-common then?

sudo apt-get install postgresql-common
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-common : Breaks: logrotate (>= 3.8) but 3.8.3-3ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

Anyone know what to do?

share|improve this question
    
sudo apt-get install -f –  nickanor May 17 '13 at 19:40
    
@nickanor Afraid not, I've tried that and there's no change. –  EddyThe B May 17 '13 at 19:57

3 Answers 3

up vote 1 down vote accepted

I have a solution for you that although will not resolve the package problems it will hopefully give you a working postgresql system.

First, uninstall all installed postgresql packages - and I mean both clients and server.

Now download from here the appropriate EnterpeiseDB installer for your system.

Run the installer and you will get a clean postgresql distribution including clients in /opt. You can then select additional software to install through the stackbuilder gui (odbc/jdbc drivers, replication, even an instance of apache web server) The installer also creates a uninstall script, so removing everything is a piece of cake.

I hope you find this helpful.

share|improve this answer
    
Thanks, very helpful, stackbuilder even contains postgis, so I think I have everything I need now. Thanks. –  EddyThe B May 17 '13 at 21:14

This problem does not occur in my system... The package info for logrotate says that it breaks postgresql-common for versions less than 1.26, but the current version of postgresql-common is 1.40 (so it is not affected).

I assume your system is not up to date so try sudo apt-get update && sudo apt-get dist-upgrade. Then try sudo apt-get install postgis.

If this doesn't work, try removing PostgreSQL if you have it installed and do sudo apt-get install postgresql postgis. Notice that you only need to install postgresql-9.1-postgis if you are using postgresql-9.1 (which is not the Ubuntu 'default' package for PostgreSQL). It would be a good idea to show us which version of PostgreSQL you have installed.

share|improve this answer
    
I don't have any version of postgresql installed. <code>apt-get remove postgresql</code> confirms that, unless it's called something else. (and it's a brand new install of Ubuntu13.04 so I'd remember if I'd installed it) –  EddyThe B May 17 '13 at 20:40
    
Then you should try updating your system and then installing postgis as said in the second paragraph of my answer. –  edwin May 19 '13 at 0:43

If you are using Ubuntu 13.04 Raring Ring Tail, try this:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install postgresql-9.1-postgis-2.0-scripts

Source: http://gingerjoos.com/blog/code/installing-postgis-on-ubuntu-13-04-raring-ringtail

I know this is better suited as a comment, but requires 50 rep!

share|improve this answer

Your Answer

 
discard

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.