在 ubuntu 12.04 上安装 postgresql 9.3

在 ubuntu 12.04 上安装 postgresql 9.3

我正在尝试在 Ubuntu 12.04 上安装 PG 9.3

---- Begin output of apt-get -q -y install postgresql-client-9.3=9.3~beta1-1.pgdg12.4+2 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-client-9.3 : Depends: libpq5 (>= 9.3~beta1) but 9.2.4-1.pgdg12.4+1 is to be installedSTDERR: E: Unable to correct problems, you have held broken packages.
---- End output of apt-get -q -y install postgresql-client-9.3=9.3~beta1-1.pgdg12.4+2 ----

我已经安装了 libpq5,但显然得到的版本不正确。

我如何安装正确的版本?

答案1

尝试这个:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
sudo apt-get update
sudo apt-get install postgresql-9.3 pgadmin3

对我来说效果很好。

来源:如何:在 Ubuntu 上安装 PostgreSQL 9.3 - 完整指南

答案2

尝试

apt-get install -t precise-pgdg postgresql-client-9.3

您还需要“允许”它从这个非标准存储库获取所有必要的依赖项。

答案3

您可以临时安装http://pkgs.org/download/libpq5

libpq-dev如果您想安装,您还需要 postgresql-server-9.3

相关内容