我尝试在 Ubuntu 18.04 上安装 postgresql 9.4(因为支持 BDR),然后这个建筑教程。
但是当我为 postgres 安装一些依赖项时,它会出现错误
root@ubuntu:/home/ubuntu# sudo apt-get build-dep postgresql-9.4
Reading package lists... Done
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:
builddeps:postgresql-9.4 : Depends: openjade but it is not installable
Depends: docbook-dsssl but it is not installable
Depends: docbook-xml but it is not installable
Depends: docbook-xsl but it is not installable
Depends: docbook but it is not installable
Depends: opensp but it is not installable
E: Unable to correct problems, you have held broken packages.
可以在 ubuntu 18.04 上安装 postgresql 9.4 吗?谢谢。
答案1
步骤 1:添加 PostgreSQL Apt 存储库
$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
$ wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
第 2 步:安装 PostgreSQL
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install postgresql postgresql-contrib libpq-dev pgadmin3
步骤 3:连接到 PostgreSQL
$ sudo su - postgres
$ psql
要列出数据库,请输入以下命令
postgres-# \l
信用数字海洋
答案2
当我尝试在 Centos 7 中安装 PostgreSQL 9.4 或更高版本时遇到了同样的问题。
但我发现 PostgreSQL 网站上有多个发行版和不同版本的二进制文件。
对于 Ubuntu,PostgreSQL 维护其存储库,有关启用和安装它们的说明可以在以下位置找到:https://www.postgresql.org/download/linux/ubuntu/
就我而言,它是从那里编译它或安装它。