PostGIS installation error - Ubuntu with dependency request

I am new to postgre and Ubuntu. I am running a virtual machine with Ubuntu 14.04 LTS Trusty. I am trying to install PostgreSql9.4 Database and PostGIS 2.1. Here are the commands that I ran on an 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 get 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 a few places and saw a lot of answers, but none of them work for me. I also tried PostgreSQL9.3 and was unable to succeed. Thanks in advance for your help. Thanks

+6
source share
3 answers

You probably have a candidate with a higher version of packages in the postgresql repository, and then in your official distribution (hence the unsatisfied dependencies). A possible solution is to install the same package from your distribution channels, checking if they are available as candidates (cache policy) and choosing specific versions to install (also for dependencies).

On my system, it looks like this:

 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 

Then you want to install the lower version with:

 $ sudo apt-get install pgadmin3=1.14.2-2 pgadmin3-data=1.14.2-2 
+8
source

To add PostGIS by linking the answer, I just posted it on Ubuntu: https://askubuntu.com/questions/621383/installing-postgis-on-ubuntu-15-04

Quick summary: I am also new to Ubuntu, but my understanding is: a) postgresql-9.4 doesn't have postgis for ubuntu yet and b) there is a version compatibility issue between ubuntugis and trusty, the steps I used to fix it:

  • uncheck or uninstall 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 find out which versions of postgis are available)

  • confirm the installation using psql , in psql run CREATE EXTENSION postgis; and confirm the addition with \dx

+2
source

This is what I did to finally install pgadmin3:

First I checked the available version in the repository:

 apt-cache policy pgadmin3 

Then install this version (may change over time, use the correct version shown by the previous command):

 sudo apt-get install pgadmin3=1.22.2-1 pgadmin-data=1.22.2-1 
0
source

Source: https://habr.com/ru/post/984218/


All Articles