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
Related videos on Youtube
Author by
Joe Morano
Updated on September 18, 2022Comments
-
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?
-
Admin about 9 yearsPlease edit your question and add the output of
apt-cache policy postgresql
-
Admin about 9 yearspossible duplicate of Why don't the Ubuntu repositories have the latest versions of software?
-
Admin about 9 yearsRemember to do
sudo apt-get update && sudo apt-get upgrade
before installing. -
Admin about 9 yearsHave you set repository as given there? Also visit askubuntu.com/q/378558
-
-
Joe Morano about 9 yearsI got back "E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."
-
Pilot6 about 9 yearsSo run "sudo apt-get install -f".
-
Joe Morano about 9 yearsNot "sudo apt-get -f install"?
-
Pilot6 about 9 yearsIt does not matter.
-
xunilk about 9 yearsBy 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 about 9 years14.04 IS LTS. And it is supported till April 2019.
-
Mattis over 8 yearsSo what if you want to use the 9.4 version, which actually have the functionality (jsonb) that I need?
-
noogui almost 7 yearsthis saved my ass. thanks a lot. tried 9.6, 9.4 , 9.2 to no avail. hahaha
-
noogui almost 7 yearshow do i execute this. coming from a windows noob user. can you give me commands to type line by line in the cmd
-
Todd over 6 yearsThis 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 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 likevim
,nano
, oremacs
. In that file youve created, just add the one single line starting withdeb
- 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 over 4 yearsThis should be the accepted answer, helps users on other platforms such as Debian or other versions of Ubuntu altogether.