我正在尝试在我的Ubuntu 13.04系统上安装Postgres。为此,我运行了以下命令......
$ sudo apt-get update
$ sudo apt-get install postgresql-common -t raring
两者都很好。然后我尝试通过运行...
来安装客户端$ sudo apt-get install postgresql-9.2
导致以下错误消息...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql-9.2 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' has no installation candidate
9.2会被“废弃”的概念对我来说似乎很奇怪,因为当我去Postgres网站查看Ubuntu installation page时,我被告知要运行命令......
apt-get install postgresql-9.2
答案 0 :(得分:3)
尝试基于以下主题
https://serverfault.com/questions/514329/installing-postgres-on-ubuntu-package-not-available
在Ubuntu官方存储库中,只有PostgreSQL 9.1可用。这就是为什么它不能被找到的原因。
为了使用apt在您的VPS中获取PostgreSQL v9.2,您应该遵循此处找到的Ubuntu的官方> PostgreSQL程序
它包括将PostgreSQL官方存储库添加为您的存储库源
之一创建文件/etc/apt/sources.list.d/pgdg.list
插入此行deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
导入存储库签名密钥wget --quiet -O - https://www.postgresql.org/media /keys/ACCC4CF8.asc | sudo apt-key add -
刷新您的存储库缓存sudo apt-get update
现在你可以简单地做sudo apt-get install postgresql-9.2