I am running into this issue where I am trying to install postgresql-ll and I followed the instructions given at https://wiki.postgresql.org/wiki/Apt. I have also read previous posts related to this issue and they aren't running into same issue as I am.

When I run apt-get install I get the following

sudo apt-get install postgresql-11 pgadmin4

E: Unable to locate package postgresql-11
E: Unable to locate package pgadmin4

I am not sure whether this error means that apt is unable to locate the repository or whether within the repository it is unable to locate the package postgresql-11. Since both packages are not being found I am guessing it is unable to find the repository.

However, I have followed repository installation instructions as well as shown below:

cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main

In the .list file I have tried both the URLs: http://apt.postgresql.org/pub/repos/apt http://apt.postgresql.org/pub/repos/apt/

Notice the second one has a trailing slash (wasn't sure if that made a difference). Anyone has any debugging suggestions or thoughts?

1 Answer 1


After spending 2-3 hours on this problem I realized that I had never run apt-get update after adding the pgdg.list config file. So indexes of packages available from this repository was not available on my local host. As a result apt-get install was unable to find the package.

I will probably not make this mistake again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .