16

I'm using Ubuntu 14.04. I'm trying to download postgresql using this guide.

But when I run the command sudo apt-get install postgresql-9.4 in my terminal, I get this error message:

E: Unable to locate package postgresql-9.4
E: Couldn't find any package by regex 'postgresql-9.4'

What am I doing wrong?

4
24

You can install postgres 9.4 on Ubuntu 14.04!

Follow the instructions on http://www.postgresql.org/download/linux/ubuntu/:

Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository:

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

Import the repository signing key, and update the package lists:

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

Now you can install with

sudo apt-get install postgresql-9.4
3
  • 1
    how do i execute this. coming from a windows noob user. can you give me commands to type line by line in the cmd
    – noogui
    Sep 5 '17 at 6:08
  • 1
    @noogui literally just copy paste the above in your terminal. To "create the file" just type sudo touch /etc/apt/sources.list.d/pgdg.list or use a program like vim, nano, or emacs. In that file youve created, just add the one single line starting with deb - that is the location of the postgres package repository. Then just copy the rest of the commands above and paste it into your terminal - it will add the authentication key for your system and that repository. Run the final command above to install the 9.4 package from the repository.
    – Todd
    Sep 29 '17 at 15:32
  • This should be the accepted answer, helps users on other platforms such as Debian or other versions of Ubuntu altogether. Nov 20 '19 at 13:46
8

That is because in Ubuntu 14.04 repositories there is postgresql-9.3 version. So run

sudo apt-get install postgresql-9.3
9
  • I got back "E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."
    – Joe Morano
    May 9 '15 at 21:22
  • So run "sudo apt-get install -f".
    – Pilot6
    May 9 '15 at 21:25
  • Not "sudo apt-get -f install"?
    – Joe Morano
    May 9 '15 at 21:26
  • It does not matter.
    – Pilot6
    May 9 '15 at 21:27
  • 4
    So what if you want to use the 9.4 version, which actually have the functionality (jsonb) that I need?
    – Mattis
    Nov 4 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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