I am running Ubuntu 14.04 and have pgadmin3 version 1.18.1, PostgreSQL 9.4 installed. I am new to pgadmin3.
I want to upgrade to pgadmin3 1.20.0.
So I used
sudo apt-get update
sudo apt-get install pgadmin3
Then I had 2 different versions [1.18.q and 1.20.0] of pgadmin3 installed on my machine. So I tried to remove pgadmin3 using these commands seperately,
sudo apt-get remove pgadmin3
sudo apt-get remove --auto-remove pgadmin3
also tried,
sudo apt-get purge pgadmin3
sudo apt-get purge --auto-remove pgadmin3
but this removed the 1.20.0 version and not 1.18.1.
I tried removing the 1.18.1 version by using the same commands then it says that the pgadmin3 is not installed.
What should I do to have pgadmin3 version 1.20.0 installed on my machine? I want to remove version 1.18.1-2.
This is the link to the snapshot which shows that I have 2 versions installed
When I do,
apt-cache show pgadmin3 | grep Version:
it shows,
Version: 1.20.0-3.pgdg14.04+1
Version: 1.20.0-3.pgdg12.4+1
Version: 1.18.1-2
EDIT
Output of,
apt-cache policy pgadmin3
is:
pgadmin3: Installed: 1.20.0-3.pgdg14.04+1 Candidate: 1.20.0-3.pgdg14.04+1 Version table: *** 1.20.0-3.pgdg14.04+1 0 500 trusty-pgdg/main amd64 Packages 100 /var/lib/dpkg/status 1.20.0-3.pgdg12.4+1 0 500 precise-pgdg/main amd64 Packages 1.18.1-2 0 500 trusty/universe amd64 PackagesThe output of command,
grep -r 'pgadmin3' /usr/share/applications
is
/usr/share/applications/pg-doc-pgadmin-9_3.desktop:Exec="/opt/PostgreSQL/9.3/scripts/launchbrowser.sh" file:///opt/PostgreSQL/9.3/pgAdmin3/share/pgadmin3/docs/en_US/index.html
/usr/share/applications/pgadmin3.desktop:Exec=pgadmin3
/usr/share/applications/pgadmin3.desktop:Icon=pgadmin3
/usr/share/applications/bamf-2.index:pg-doc-pgadmin-9_3.desktop "/opt/PostgreSQL/9.3/scripts/launchbrowser.sh" file:///opt/PostgreSQL/9.3/pgAdmin3/share/pgadmin3/docs/en_US/index.html false
/usr/share/applications/bamf-2.index:pgadmin3.desktop pgadmin3 falseANDFor:
# grep -r 'pgadmin3' ~/.local/share/applications
Output is:
grep: /root/.local/share/applications: No such file or directory
For:
# command -v pgadmin3
it shows:
/usr/bin/pgadmin3
1 Answer
pgadmin version 1.20 is currently installed on your system.
I don't think you've ever had both 1.18 and 1.20 of pgadmin3 installed at the same time. The icons on the desktop have little relation to the actual installed versions of the applications.
In the case of the pgadmin3 package, the Debian APT package management system prevents you from having more than one version installed at the same time.
When you install an application for which multiple versions are available, look at the output of apt-get install to see the installed version number.
The output of your apt-cache show pgadmin3 output shows that you have 3 versions of pgadmin3 available for installation:
$ apt-cache show pgadmin3 | grep Version:
Version: 1.20.0-3.pgdg14.04+1
Version: 1.20.0-3.pgdg12.4+1
Version: 1.18.1-2
$(The version 1.20.0-3.pgdg12.4+1 is for Ubuntu Precise 12.4. You should probably remove precise-pgdg from your software sources.)
I hope the following sections help you understand the steps you've been through and what was actually happening:
Default Trusty pgadmin Installation
This is on Trusty 14.04 with pgadmin3 1.18.1-2 installed. Neither trusty-pgdg or precise-pgdg appear in the software sources.
$ apt-cache policy pgadmin3
pgadmin3: Installed: 1.18.1-2 Candidate: 1.18.1-2 Version table: *** 1.18.1-2 0 500 trusty/universe amd64 Packages 100 /var/lib/dpkg/status
$Show installed versions of pgadmin3:
$ dpkg-query -W pgadmin3
pgadmin3 1.18.1-2
$ Invoke pgadmin3 -v to show the executable version:
$ pgadmin3 -v
pgAdmin III 1.18.1
$Adding the trusty-pgdg repo (contains newer pgadmin3)
Now I've created a file /etc/apt/sources.list.d/postgresql.list containing the line:
deb trusty-pgdg mainAnd then run sudo apt-get update. Looking at the apt-cache policy we see now a new version (1.20.0-3.pgdg14.04+1) from the trusty-pgdg repo. Note the line "Candidate:" which shows which version is the best candidate to be installed:
$ apt-cache policy pgadmin3
pgadmin3: Installed: 1.18.1-2 Candidate: 1.20.0-3.pgdg14.04+1 Version table: 1.20.0-3.pgdg14.04+1 0 500 trusty-pgdg/main amd64 Packages *** 1.18.1-2 0 500 trusty/universe amd64 Packages 100 /var/lib/dpkg/status
$NOTE: Because there is a new "Candidate", either apt-get dist-upgrade or apt-get install pgadmin3 will install the new version of pgadmin3.
Install pgadmin3 again to get the most recent version from new repo
Now install pgadmin3 again, to get version 1.20 (we already have trusty-pgdg in our software sources list). apt-get install by default attempts to install the latest version, shown by the line "Candidate:" in the policy above:
$ sudo apt-get install pgadmin3
[ . . . ]
Preparing to unpack .../pgadmin3_1.20.0-3.pgdg14.04+1_amd64.deb ...
Unpacking pgadmin3 (1.20.0-3.pgdg14.04+1) over (1.18.1-2) ...
Preparing to unpack .../pgadmin3-data_1.20.0-3.pgdg14.04+1_all.deb ...
Unpacking pgadmin3-data (1.20.0-3.pgdg14.04+1) over (1.18.1-2) ...
[ . . . ]
Setting up pgadmin3-data (1.20.0-3.pgdg14.04+1) ...
Setting up pgadmin3 (1.20.0-3.pgdg14.04+1) ...
[ . . . ]
$And verify the installed version:
$ dpkg-query -W pgadmin3
pgadmin3 1.20.0-3.pgdg14.04+1
$
$ pgadmin3 -v
pgAdmin III 1.20.0
$Also shown by apt-cache policy:
$ apt-cache policy pgadmin3
pgadmin3: Installed: 1.20.0-3.pgdg14.04+1 Candidate: 1.20.0-3.pgdg14.04+1 Version table: *** 1.20.0-3.pgdg14.04+1 0 500 trusty-pgdg/main amd64 Packages 100 /var/lib/dpkg/status 1.18.1-2 0 500 trusty/universe amd64 Packages
$If you try to install again, no action will be taken:
$ sudo apt-get install pgadmin3
Reading package lists... Done
Building dependency tree
Reading state information... Done
pgadmin3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ 3