1. Apt-get 安装postgresql postgresql-contrib
1.1 apt-get install postgresql postgresql-contrib, 安装出奇的顺利,并没有出现不能安装的情况。看了执行过程,发现并没有安装postsql,又单独安装了一次postgresql,发现人家只是装了postgresql-doc,果然没那么简单。
apt-get install postgresql postgresql-contrib,执行结果如下:
root@iZwz984fp76m132ex9esc8Z:/# sudo apt-get install postgresql postgresql-contrib
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version (12+214ubuntu0.1).
The following NEW packages will be installed:
postgresql-contrib
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 3,932 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu focal-updates/main amd64 postgresql-contrib all 12+214ubuntu0.1 [3,932 B]
Fetched 3,932 B in 0s (41.1 kB/s)
Selecting previously unselected package postgresql-contrib.
(Reading database ... 116914 files and directories currently installed.)
Preparing to unpack .../postgresql-contrib_12+214ubuntu0.1_all.deb ...
Unpacking postgresql-contrib (12+214ubuntu0.1) ...
Setting up postgresql-contrib (12+214ubuntu0.1) ...
再次执行apt-get install postgresql 指令,执行结果:
xxxxxxxx:/data/env/venv-site# apt-get install postgresql
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
postgresql-doc
The following NEW packages will be installed:
postgresql
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 0 B/3,924 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
Selecting previously unselected package postgresql.
(Reading database ... 116911 files and directories currently installed.)
Preparing to unpack .../postgresql_12+214ubuntu0.1_all.deb ...
Unpacking postgresql (12+214ubuntu0.1) ...
Setting up postgresql (12+214ubuntu0.1) ...
xxxxxxxxxx:/data/env/venv-site#
用apt-get remove postgresql