Ubuntu – How to install PostgreSQL on Ubuntu 13.04

13.04postgresqlsoftware installation

How to install PostgreSQL in Ubuntu 13.04?

I followed by this tutorial, How to install postgreSQL 9-2 – UbuntuGeek.com

But in logs it says:

the package is deprecated and no longer will be used

So, what is the package name for the latest postgres? keyring? it doesn't work if it is "keyring".

Best Answer

As your log describes the package is deprecated. But more specifically it has moved. From the PPA owner's page:

In about a year (during Ubuntu 12.04 LTS's life time, but after 12.10 is end-of-life) this PPA is going to be deprecated. Please consider moving to apt.postgresql.org soon.

I had issues upgrading to 13.04 with PostgreSQL 9.2 installed on my 12.10 (as described here). This resulted in me unistalling PostgreSQL 9.2 and upgrading. If you also have this issue, back-up your database or it will be lost when uninstalled.

After the upgrade, I uncommented the PostgreSQL repo in /etc/apt/sources.list.d/pgdg.list and ran:

sudo apt-get update

If you don't already have the PostgreSQL repo added, you should follow these instructions, with the exception that there is not a package for Raring (13.04) yet. Just use Precise.

For reference, my pgdg.list file looks like:

deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main 

And running the update, I can see it getting PostgreSQL 9.2 from the precise package (Whereas, other updates are raring):

Get:5 http://apt.postgresql.org precise-pgdg Release.gpg [836 B]
Get:7 http://apt.postgresql.org precise-pgdg Release [25.6 kB]
Get:10 http://apt.postgresql.org precise-pgdg/main amd64 Packages [27.6 kB]
Get:14 http://apt.postgresql.org precise-pgdg/main i386 Packages [27.6 kB]
Ign http://apt.postgresql.org precise-pgdg/main Translation-en_US
Ign http://apt.postgresql.org precise-pgdg/main Translation-en

Running psql --version to confirm this, the terminal outputs:

psql (PostgreSQL) 9.2.4
Related Question