我尝试使用 ubuntu wiki 上列出的命令从基本 apt 目录安装 Postgresql,这些命令是 sudo apt-get install postgresql postgresql-contrib
这将返回一个错误,对我来说唯一有效的方法是通过这种方式安装:https://tecadmin.net/install-postgresql-server-on-ubuntu/
有人能告诉我从 apt 目录安装的正确方法是什么吗?谢谢!
答案1
您的前 3 个站点应该是Ubuntu 软件包,发射台和官方网站。
版本 11仅适用于19.04,包名称和安装命令为:
sudo apt install postgresql-11
结果:
$ sudo apt install postgresql-11
[sudo] password for rinzwind:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libllvm7 libpq5 postgresql-client-11 postgresql-client-common
postgresql-common sysstat
Suggested packages:
postgresql-doc-11 libjson-perl isag
The following NEW packages will be installed:
libllvm7 libpq5 postgresql-11 postgresql-client-11 postgresql-client-common
postgresql-common sysstat
0 upgraded, 7 newly installed, 0 to remove and 31 not upgraded.
Need to get 27,4 MB of archives.
After this operation, 104 MB of additional disk space will be used.
Do you want to continue? [Y/n]
如果您想要 18.04,您也可以从上面的第 4 个链接下载它,但您需要检查所有依赖项。