# Cannot install Postgres 9.1 on a fresh Debian 6.0

I have a fresh Debian 6.0 install. I have installed build-essential and added:

deb http://backports.debian.org/debian-backports squeeze-backports main


in /etc/apt/sources.list

I now try to install Postgres 9.1 but I have the following error:

The following packages have unmet dependencies:
postgresql-9.1 : Depends: libpq5 (>= 9.1~) but 8.4.12-0squeeze1 is to be installed
Depends: postgresql-client-9.1 but it is not going to be installed
Depends: postgresql-common (>= 115~) but 113 is to be installed


Is there any additional stuff to install prior the postgres installation ?

-
what command did you run to install postgres? apt-get -t squeeze-backports install postgresql-9.1 ? –  cas Aug 1 '12 at 9:42
I used the command: apt-get install postgresql-9.1 –  Luc Aug 1 '12 at 9:52
try the -t squeeze-backports option as in my comment/question or Womble's answer. What he said is exactly right. –  cas Aug 1 '12 at 10:00

Well, build-essential is irrelevant to this problem. You're not installing the package correctly; use the -t squeeze-backports option to make the backports repository the "default" repository for the purposes of this apt-get run, which should allow the correct versions of the dependent packages to be installed. You're getting the error you are now because whilst postgresql-9.1 isn't available in squeeze, and therefore will be installed from the backports repo, the other packages do have available versions in squeeze, and due to the low default priority of backports repositories, the versions of the packages in squeeze are being preferred.