Problems installing postgresql-9.4: Unable to locate package

47,126

Solution 1

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

sudo apt-get install postgresql-9.3

Solution 2

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
Share:
47,126

Related videos on Youtube

Joe Morano
Author by

Joe Morano

Updated on September 18, 2022

Comments

  • Joe Morano
    Joe Morano almost 2 years

    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?

  • Joe Morano
    Joe Morano about 9 years
    I got back "E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."
  • Pilot6
    Pilot6 about 9 years
    So run "sudo apt-get install -f".
  • Joe Morano
    Joe Morano about 9 years
    Not "sudo apt-get -f install"?
  • Pilot6
    Pilot6 about 9 years
    It does not matter.
  • xunilk
    xunilk about 9 years
    By the way, I think that the 14.04 version (no LTS) is no longer supported. This answer won't work. On the other hand, today, I installed postgresql-9.4+postgis-2.1 in Debian 8. In my Ubuntu 14.10 it was unfunctional because there are two libgdal versions totally incompatible. If you have the last R version with rgdal it is probable that QGIS will be broken. I experienced that. The same problem with postgres+postgis.
  • Pilot6
    Pilot6 about 9 years
    14.04 IS LTS. And it is supported till April 2019.
  • Mattis
    Mattis over 8 years
    So what if you want to use the 9.4 version, which actually have the functionality (jsonb) that I need?
  • noogui
    noogui almost 7 years
    this saved my ass. thanks a lot. tried 9.6, 9.4 , 9.2 to no avail. hahaha
  • noogui
    noogui almost 7 years
    how do i execute this. coming from a windows noob user. can you give me commands to type line by line in the cmd
  • Todd
    Todd over 6 years
    This should not be the accepted answer. Note what @Mattis said above - 9.4 is required for :jsonb. This answer is basically like "just deal with it, you dont get 9.4" which is in no way helpful to those whom need 9.4 @TimSolo has the correct answer, which should be accepted.
  • Todd
    Todd over 6 years
    @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.
  • Cécile Fecherolle
    Cécile Fecherolle over 4 years
    This should be the accepted answer, helps users on other platforms such as Debian or other versions of Ubuntu altogether.