![安装 postgresql。未满足依赖项“postgresql-common”](https://linux22.com/image/836254/%E5%AE%89%E8%A3%85%20postgresql%E3%80%82%E6%9C%AA%E6%BB%A1%E8%B6%B3%E4%BE%9D%E8%B5%96%E9%A1%B9%E2%80%9Cpostgresql-common%E2%80%9D.png)
我正在尝试在 Ubuntu 13.04 上安装 postgis。我尝试在线关注许多不同的博客和 wiki,但总是遇到同样的问题...
$sudo apt-get install postgis postgresql-9.1-postgis
....
Package postgresql-9.2-postgis 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
E: Package 'postgresql-9.2-postgis' has no installation candidate
所以我尝试 9.1...
$sudo apt-get install postgis postgresql-9.1-postgis
....
The following packages have unmet dependencies:
postgresql-9.1-postgis : Depends: postgresql-9.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
没有运气,所以我去寻找 postgresql-9.1......
sudo apt-get install postgresql-9.1
...
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-9.1 : Depends: postgresql-common (>= 115~) but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.
那么 postgresql-common 呢?
sudo apt-get install postgresql-common
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-common : Breaks: logrotate (>= 3.8) but 3.8.3-3ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
有人知道该怎么办吗?
答案1
我有一个解决方案给你,虽然它不能解决软件包问题,但它希望能给你一个可以正常运行的 postgresql 系统。
首先,卸载所有已安装的 postgresql 包 - 我指的是客户端和服务器。
现在从下载这里适合您系统的 EnterpeiseDB 安装程序。
运行安装程序,您将获得一个干净的 postgresql 发行版,其中包括 /opt 中的客户端。然后,您可以通过 stackbuilder gui 选择要安装的其他软件(odbc/jdbc 驱动程序、复制,甚至 apache web 服务器的实例)。安装程序还会创建一个卸载脚本,因此删除所有内容都是小菜一碟。
我希望你觉得这有帮助。
答案2
我的系统中没有出现此问题... 软件包信息logrotate
表明它postgresql-common
在低于 1.26 的版本中会中断,但的当前版本postgresql-common
是 1.40(因此不受影响)。
我假设你的系统是不是已更新,所以尝试一下sudo apt-get update && sudo apt-get dist-upgrade
。然后尝试sudo apt-get install postgis
。
如果这不起作用,请尝试删除已安装的 PostgreSQL,然后执行。请注意,只有在使用时才sudo apt-get install postgresql postgis
需要安装(这不是 Ubuntu 的 PostgreSQL“默认”包)。向我们展示您安装的 PostgreSQL 版本是个好主意。postgresql-9.1-postgis
postgresql-9.1
答案3
如果你正在使用 Ubuntu 13.04 Raring Ring Tail,请尝试以下操作:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install postgresql-9.1-postgis-2.0-scripts
来源:http://gingerjoos.com/blog/code/installing-postgis-on-ubuntu-13-04-raring-ringtail
我知道这更适合作为评论,但需要 50 点声望!