实际操作系统和 PostgreSQL 版本:
CentOS 7.3,PostgreSQL 10.1 更新到 10.2。
脚步:
停止服务:
/bin/systemctl stop postgresql-10.service
检查可用的软件包更新:
yum check-update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.ca.planethoster.net
* extras: muug.ca
* updates: muug.ca
libgudev1.x86_64 219-42.el7_4.7 updates
pgdg-centos10.noarch 10-2 pgdg10-updates-testing
systemd.x86_64 219-42.el7_4.7 updates
systemd-libs.x86_64 219-42.el7_4.7 updates
systemd-sysv.x86_64 219-42.el7_4.7 updates
更新 PostgreSQL:
yum update pgdg-centos10.noarch
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror2.evolution-host.com
* extras: muug.ca
* updates: muug.ca
Resolving Dependencies
--> Running transaction check
---> Package pgdg-centos10.noarch 0:10-1 will be updated
---> Package pgdg-centos10.noarch 0:10-2 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================================================
Updating:
pgdg-centos10 noarch 10-2 pgdg10-updates-testing 4.6 k
Transaction Summary
========================================================================================================================================================================================================
Upgrade 1 Package
Total download size: 4.6 k
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
pgdg-centos10-10-2.noarch.rpm | 4.6 kB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : pgdg-centos10-10-2.noarch 1/2
Cleanup : pgdg-centos10-10-1.noarch 2/2
Verifying : pgdg-centos10-10-2.noarch 1/2
Verifying : pgdg-centos10-10-1.noarch 2/2
Updated:
pgdg-centos10.noarch 0:10-2
Complete!
重启服务:
/bin/systemctl start postgresql-10.service
检查版本:
psql -U myuser -d mydb -c "SELECT version()"
Password for user myuser:
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
(1 row)
仍为 10.1。有什么解释吗?
yum update pgdg-centos10.noarch
仅更新存储库定义。要更新实际的 Postgres 二进制文件,您需要使用