How to Install PostgreSQL 9.2 on Ubuntu 13.04 Raring Ringtail

Hello Linux and Unix Geeksters.

In this article I will show you how to install PostgreSQL 9.2 on Ubuntu 13.04 Raring Ringtail.

Because there are no PostgreSQL packages for Ubuntu 13.04 Raring Ringtail yet, we will use the files for Ubuntu 12.04 Precise Pangolin.

Follow this steps for a successful installation:

Step 1. Install some dependencies:

$ sudo apt-get install libpq-dev libpq5

Step 2. Add the repo:

$ sudo su
# echo 'deb precise-pgdg main' >> /etc/apt/sources.list.d/pgdg.list

Step 3. Add the key:

# wget --quiet -O - | apt-key add -

Step 4. Upgrade (thank you for the help Laurent):

$ sudo apt-get update

Step 5. Install PostgreSQL:

$ sudo apt-get -t raring install postgresql-common -t raring postgresql-9.2 postgresql-client-9.2

Liked it? Take a second to support Geekster on Patreon!
Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!
5 comments on “How to Install PostgreSQL 9.2 on Ubuntu 13.04 Raring Ringtail
  1. info says:

    This isn’t quite working for us. At Step 5 after executing the command we receive the following:

    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:
    postgresql-9.2 : Depends: postgresql-client-9.2 but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    Any ideas would be very helpful how to proceed here.
    Many Thanks.

    • Vikram says:

      I had to do following:
      sudo apt-get update
      sudo apt-get install postgresql-common -t raring
      sudo apt-get install postgresql-9.2
      It worked for me 🙂

  2. Rick says:


    sudo apt-get install postgresql-common -t raring postgresql-client-9.2

  3. Laurent says:

    After step 4: sudo apt-get update should type
    # sudo apt-get upgrade

    This will correct and remove the error
    E: Unable to correct problems, you have held broken packages.

    then step 5

  4. Devon says:

    @ Laurent, you just saved me hours of reinstalling & reconfiguring. I was just about to uninstall Ubuntu 13.04 and go back to 12.04. I would’ve had no choice but to do that, ’cause I need to have a working PostgreSQL. Thank you!! And thank you Geekster for writing this post… altho you should update it to reflect the “upgrade” instead of “update”.

Leave a Reply to Vikram Cancel reply

Your email address will not be published. Required fields are marked *


Support LinuxG via Patreon
Support on Patreon!


Subscribe to get the latest Linux news and how to guides directly on your e-mail!