Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up a VPS with Ruby and Postgres. On my local machine, I have postgresql 9.2.3 (client and server) installed and therefore wanted to install the same on my VPS. Following the instructions of this blog post installing postgres on ubuntu (with the only difference that I'm trying to install 9.2.3. and he installed 9.1), I did the following

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'

However, as you can see, it couldn't find a package postgresql-9.2.3. Yet, I have that package installed on my local machine (which I installed on my Mac with Homebrew).

Can you help me understand what I'm doing wrong?

Update I also tried to install it leaving off the '3' at the end like you see below but it didn't work as you can see.

 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


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
share|improve this question
what does apt-get update && apt-cache search ^postgresql-9 output? – dawud Jun 8 '13 at 14:50
@dawud posted the contents of running that in the update to the OP. – Michael Jun 8 '13 at 14:54
so how do you expect to install a package that is not available? – dawud Jun 8 '13 at 14:55
@dawud I didn't consider the possibility that it wouldn't be available since I installed 9.2.3 on my local machine (using Homebrew). This is my first time setting up a VPS. Why wouldn't it be available? – Michael Jun 8 '13 at 14:58
up vote 18 down vote accepted

In Ubuntu official repositories only PostgreSQL 9.1 is available. That is why it couldn't be found.

In order to get PostgreSQL v9.2 in your VPS using apt you should follow the official PostgreSQL procedure for Ubuntu found here

It consists of adding PostgreSQL official repository as one of your repository source

  1. Create the file /etc/apt/sources.list.d/pgdg.list

  2. Insert this line deb precise-pgdg main

  3. Import the repository signing key wget --quiet -O - | sudo apt-key add -

  4. Refresh your repositories cache sudo apt-get update

Now you can simply do sudo apt-get install postgresql-9.2

share|improve this answer
Didn't know there was a repo for this. +1 – dawud Jun 8 '13 at 15:10
Thanks a lot. See, even my downvoted question helped experienced users .... – Michael Jun 8 '13 at 15:10
I found this page very helpful You can also install postgres-contrib-9.2 – nu everest Jun 29 '14 at 3:30

The fact that you were able to install postgresql-9.2.3 on a different operating system using different repositories is not relevant.

If you query the Ubuntu repositories using the web or through apt, you will notice that the version shipped with quantal is 9.1.

The exact reason why postgresql-9.2.3 is not available in quantal is because it was not accepted in the released distribution by the time it was frozen.

To use postgresql-9.2.3 in Ubuntu, you need to compile it yourself. There are several approaches to this, like backporting or packaging an upstream release with checkinstall or fpm.

share|improve this answer
Thanks for the explanation. I'm sort of a newbie about to manage a professional server :( – Michael Jun 8 '13 at 15:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.