Zhixian's Tech Blog

2014-12-31

How to Install Postgresql onto Ubuntu (Trusty Tahr)

Filed under: computing — Tags: , , , , , — Zhixian @ 00:08:12 am

This blog post describes how I install Postgresql 9.4 onto Ubuntu.

You may want to following this blog post, Installing Postgresql using installer from EnterpriseDB on Ubuntu instead.
The below blog post will install latest version of Postgresql at this time of writing (version 9.4).
Unfortunately, the graphical interface tool installed pgAdmin III that is installed with this set of instructions uses an older version of pgAdmin III (version 1.18.1 at this time of writing).
This version does not support Postgresql 9.4.

Summary

  1. Create Repository List File
  2. Import Signing Key
  3. Update apt-get
  4. Install Postgresql
  5. Install Additional Modules

Create Repository List File

Create the repository list file using the following command:

echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list

zhixian@SARA: ~_161

Import Signing Key

Import signing key for Postgresql by running the following command:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

zhixian@SARA: ~_162

Update apt-get

Run the following command to update your apt-get.

sudo apt-get update

zhixian@SARA: ~_163

Install Postgresql

Run the following command:

sudo apt-get install postgresql-9.4

zhixian@SARA: ~_164

Install Additional Modules

The installation above is quite bare-bones. It does not provide a graphical tool or development libraries.
To add them, run the following command:

sudo apt-get install postgresql-contrib-9.4 pgadmin3 libpq-dev postgresql-server-dev-9.4

postgresql-contrib-9.4 – additional supplied modules
libpq-dev – libraries and headers for C language frontend development
postgresql-server-dev-9.4 – libraries and headers for C language backend development
pgadmin3 – pgAdmin III graphical administration utility

zhixian@SARA: ~_165

After installation have complete, you can find the graphical tool under Applications > Programming > pgAdmin III from the desktop menu.

Workspace 1_166

Reference

Linux downloads (Ubuntu) (http://www.postgresql.org/download/linux/ubuntu/)

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: