postgres packages not found during install

June 8, 2013 11.5k views
I was referred to this article by someone on this forum for installing Postgres on ubuntu, but when I tried to install 9.2.3 (rather than 9.1 version described in the article), I ran into the following problem sudo apt-get install postgresql-9.2.3 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package postgresql-9.2.3 E: Couldn't find any package by regex 'postgresql-9.2.3' I then tried to install 9.2 (leaving off the 3 at the end) like below but ran into a different problem. sudo apt-get install postgresql-9.2 Reading package lists... Done Building dependency tree Reading state information... Done Package postgresql-9.2 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' has no installation candidate
3 Answers

I ran the following

apt-get update && apt-cache search ^postgresql-9

and got this output. Not sure if it means that nothing higher than 9.1 is available to install. Since I have 9.2.3 on my Mac, I wonder why that'd be.

Ign quantal-security InRelease
Ign quantal InRelease
Hit quantal-security Release.gpg
Ign quantal-updates InRelease
Hit quantal-security Release
Hit quantal Release.gpg
Get:1 quantal-updates Release.gpg [933 B]
Hit quantal-security/main i386 Packages
Hit quantal Release
Get:2 quantal-updates Release [49.6 kB]
Hit quantal-security/main Translation-en
Hit quantal/main i386 Packages
Hit quantal/universe i386 Packages
Ign quantal-security/main Translation-en_US
Hit quantal/main Translation-en
Hit quantal/universe Translation-en
Get:3 quantal-updates/main i386 Packages [259 kB]
Get:4 quantal-updates/universe i386 Packages [192 kB]
Hit quantal-updates/main Translation-en
Hit quantal-updates/universe Translation-en
Ign quantal/main Translation-en_US
Ign quantal/universe Translation-en_US
Ign quantal-updates/main Translation-en_US
Ign quantal-updates/universe Translation-en_US
Fetched 501 kB in 3s (148 kB/s)
Reading package lists... Done
postgresql-9.1 - object-relational SQL database, version 9.1 server
postgresql-9.1-dbg - debug symbols for postgresql-9.1
postgresql-9.1-debversion - Debian version number type for PostgreSQL
postgresql-9.1-ip4r - IPv4 and IPv4 range index types for PostgreSQL 9.1
postgresql-9.1-orafce - Oracle support functions for PostgreSQL 9.1
postgresql-9.1-pgfincore - set of PostgreSQL functions to manage blocks in memory
postgresql-9.1-pgmemcache - PostgreSQL interface to memcached
postgresql-9.1-pgmp - arbitrary precision integers and rationals for PostgreSQL 9.1
postgresql-9.1-pgpool2 - connection pool server and replication proxy for PostgreSQL - modules
postgresql-9.1-pljava-gcj - Java procedural language for PostgreSQL 9.1
postgresql-9.1-pllua - Lua procedural language for PostgreSQL 9.1
postgresql-9.1-plproxy - database partitioning system for PostgreSQL 9.1
postgresql-9.1-plr - Procedural language interface between PostgreSQL and R
postgresql-9.1-plsh - PL/sh procedural language for PostgreSQL 9.1
postgresql-9.1-postgis - Geographic objects support for PostgreSQL 9.1
postgresql-9.1-prefix - Prefix Range module for PostgreSQL
postgresql-9.1-preprepare - Pre Prepare your Statement server side
postgresql-9.1-slony1-2 - replication system for PostgreSQL: PostgreSQL 9.1 server plug-in
A lot of time the mainline ubuntu repositories won't update to the bleeding edge of versions of software. So 9.2 was probably release sometime after 12.10 (October, 2012) and thus wasn't included into the mainline.

You can try adding the ubuntu "backports" repo which sometimes takes newer versions of packages from newer releases and puts them into old repos (For example if postgres 9.2 was in 13.04)

You can also look for a "ppa" ubuntu repo. These are smaller repositories for a few packages that ubuntu community people package up as the need arises.

Finally, if you must have postgres9.2 you can always compile from the source. I would recommend apt-get removing the current version of postgres and then installing from source.
Digging a bit further I belive there is a ppa for you here:
Have another answer? Share your knowledge.