I am new to postgre and Ubuntu. I am running a VM with Ubuntu 14.04 LTS Trusty. I am trying install PostgreSql9.4 Database and PostGIS 2.1.Here are the commands I ran on the Ubuntu machine:
sudo apt-get install wget ca-certificates
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.4-postgis-2.1 pgadmin3 postgresql-contrib
However I am getting the following error.
The following packages have unmet dependencies: pgadmin3 : Depends: libwxbase3.0-0 (>= 3.0.0) but it is not installable Depends: libwxgtk3.0-0 (>= 3.0.0) but it is not installable Recommends: pgagent but it is not going to be installed postgresql-9.4-postgis-2.1 : Depends: libgdal1h (>= 1.9.0) but it is not installable Depends: libgeos-c1 (>= 3.4.2) but it is not installable Depends: liblwgeom-2.1.5 (>= 2.1.2) but it is not going to be installed Depends: libproj0 (>= 4.8.0-1) but it is not installable E: Unable to correct problems, you have held broken packages.
I searched several places and saw many responses, but none of them work for me. I also tried the PostgreSQL9.3 and couldn't succeed as well.Thanks in advance for your help. Thanks
You likely have a higher version candidate of the packages on postgresql's repository then in your official distribution (hence the unmet dependencies). A possible solution is to install the same package from your distro channels by checking if they are available as candidates (apt-cache policy) and choosing specific versions to install (also for dependencies).
On my system it looks as follows:
The following packages have unmet dependencies:
pgadmin3 : Depends: libwxbase3.0-0 (>= 3.0.2) but it is not installable
Depends: libwxgtk3.0-0 (>= 3.0.2) but it is not installable
Recommends: pgagent but it is not going to be installed
apt-cache policy pgadmin3
pgadmin3:
Installed: (none)
Candidate: 1.20.0-1.pgdg70+1
Version table:
1.20.0-1.pgdg70+1 0
500 http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg/main amd64 Packages
1.14.2-2 0
500 http://ftp5.gwdg.de/pub/linux/debian/debian/ wheezy/main amd64 Packages
You then want to install the lower version with:
$ sudo apt-get install pgadmin3=1.14.2-2 pgadmin3-data=1.14.2-2
For adding PostGIS, linking an answer I just posted to Ubuntu: https://askubuntu.com/questions/621383/installing-postgis-on-ubuntu-15-04
Quick recap: I'm also new to Ubuntu but my understanding is a) postgresql-9.4 does not yet have postgis built for ubuntu and b) there's a version compatibility issue between ubuntugis and trusty, steps I used to fix were:
uncheck or remove ubuntugis from /etc/apt/sources.list ("other software" tab)
install with sudo apt-get install postgresql-9.3-postgis-2.1
(note: use apt-cache search postgresql-9
to see what versions of postgis are available)
confirm install with psql
, in psql run CREATE EXTENSION postgis;
, and confirm added with \dx
This is what I did to finally install pgadmin3:
First I checked the available version on the repository:
apt-cache policy pgadmin3
Then installed that version (may change in time, use the proper version shown by the previous command):
sudo apt-get install pgadmin3=1.22.2-1 pgadmin-data=1.22.2-1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With