在ubuntu上安装PG数据库

在ubuntu上安装PG数据库

我正在尝试在我的Ubuntu 系统但我无法克服这个错误sudo apt-get install postgresql-9.1

Package postgresql-9.1 is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or is only available
from another source

或出现以下错误sudo apt-get install postgresql-9.4

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package postgresql-9.4
E: Couldn't find any package by regex 'postgresql-9.4'

或出现以下错误sudo apt-get install postgresql postgresql-contrib

Reading package lists... Done
Building dependency tree       
Reading state information... Done
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 : Depends: postgresql-9.3 but it is not going to be installed
 postgresql-contrib : Depends: postgresql-contrib-9.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

有谁知道为什么会这样或者我必须做什么来纠正它?(我sudo apt-get update以前跑过)。

答案1

您的机器上似乎postgres-xc安装了用于多主集群的旧版 PostgreSQL 的一个分支。问题是Postgres-XC不兼容使用 PostgreSQL。

假设您需要 PostgreSQL(而不是 Postgres-XC),我建议您完全卸载postgres-xcpostgres-xc-client然后尝试重新安装postgresql-*软件包。

相关内容