Can't install pgadmin3 on ubuntu 16.04

After I try sudo apt-get install pgadmin3 I get this message:

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:
 pgadmin3 : Depends: libwxbase2.8-0 (>= 2.8.12.1) but it is not installable
            Depends: libwxgtk2.8-0 (>= 2.8.12.1) but it is not installable
            Recommends: pgagent but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

How I can fix this?


Solution 1:

I had the same issue and after beating my head against it long enough realized that I had an obsolete pgdg.list in my sources. After removing and re-adding it, everything is great.

sudo rm /etc/apt/sources.list.d/pgdg.*
echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update -y
sudo apt-get install pgadmin3

Solution 2:

Try to add the following repository to system:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

I had the same issue and it was helped me.

Solution 3:

I've had the same issue and here how I fixed it:
1) when I tried to run sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0 apt-get told me that I have unused dependencies - pgadmin3-data and pgagent so I better remove them
2) sudo apt autoremove - removed them
3) sudo apt-get install pgadmin3 - told me that it needs to download some needed dependencies(the ones I just remove). I said yes, and the installation went OK this way
Now I am able to use the pgadmin3.