V předchozím příspěvku jsme viděli, jak aktualizovat systém CentOS 8 / RHEL 8, aby měl váš systém nejnovější aktualizace. Zřídka mohou aktualizace poškodit váš systém nebo aplikaci, která je na něm spuštěna.
V tomto případě možná budete muset vrátit aktualizované balíčky na předchozí verzi.
V tomto příspěvku uvidíme kroky, jak vrátit opravy OS na CentOS 8 / RHEL 8.
Historie aktualizací
Příkaz historie yum zobrazí seznam všech činností, které jste provedli pomocí příkazu yum, včetně záplatování OS.
yum history
Z výše uvedeného výstupu můžete vidět
ID 4 :Oprava operačního systému (Příkazový řádek:aktualizace), jak má (I) nstalla (U) pdateakce 55 balíčků.
ID 3 :Aktualizace jádra (Příkazový řádek:update -y kernel) (I) nstallakce 3 balíčků
Můžete také zjistit, jaké byly balíčky aktualizovány během historie ID 4 nebo 3 pomocí příkazu níže.
Kontroluji informace o historii ID 3.
yum history info 3
Výstup:
Transaction ID : 3
Begin time : Wed 23 Oct 2019 04:50:02 AM EDT
Begin rpmdb : 390:36e45bfafdb36c1b565f744db484c136e60d027c
End time : Wed 23 Oct 2019 04:52:29 AM EDT (147 seconds)
End rpmdb : 393:2dbf7c6498447e95a25b76af117b689bccd11b20
User : root
Return-Code : Success
Releasever : 8
Command Line : update -y kernel
Packages Altered:
Install kernel-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
Install kernel-core-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
Install kernel-modules-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
[root@centos8 ~]# yum history info 4
Transaction ID : 4
Begin time : Wed 23 Oct 2019 04:57:30 AM EDT
Begin rpmdb : 393:2dbf7c6498447e95a25b76af117b689bccd11b20
End time : Wed 23 Oct 2019 05:02:37 AM EDT (5 minutes)
End rpmdb : 394:2263176203aedb3134fb7478167919e2cb60450b
User : root
Return-Code : Success
Releasever : 8
Command Line : update
Packages Altered:
Install grub2-tools-efi-1:2.02-66.el8_0.1.x86_64 @BaseOS
Upgrade bash-4.4.19-8.el8_0.x86_64 @BaseOS
Upgraded bash-4.4.19-7.el8.x86_64 @@System
Upgrade bind-export-libs-32:9.11.4-17.P2.el8_0.1.x86_64 @BaseOS
Upgraded bind-export-libs-32:9.11.4-16.P2.el8.x86_64 @@System
Upgrade grub2-common-1:2.02-66.el8_0.1.noarch @BaseOS
Upgraded grub2-common-1:2.02-66.el8.noarch @@System
. . .
. . .
Upgrade sssd-nfs-idmap-2.0.0-43.el8_0.3.x86_64 @BaseOS
Upgraded sssd-nfs-idmap-2.0.0-43.el8.x86_64 @@System
Upgrade systemd-239-13.el8_0.5.x86_64 @BaseOS
Upgraded systemd-239-13.el8.x86_64 @@System
Upgrade systemd-libs-239-13.el8_0.5.x86_64 @BaseOS
Upgraded systemd-libs-239-13.el8.x86_64 @@System
Upgrade systemd-pam-239-13.el8_0.5.x86_64 @BaseOS
Upgraded systemd-pam-239-13.el8.x86_64 @@System
Upgrade systemd-udev-239-13.el8_0.5.x86_64 @BaseOS
Upgraded systemd-udev-239-13.el8.x86_64 @@System
Upgrade epel-release-8-6.el8.noarch @epel
Upgraded epel-release-8-5.el8.noarch @@System
Scriptlet output:
1 warning: /etc/shadow created as /etc/shadow.rpmnew
Podobně můžete vidět informace o jiných ID.
Vrátit aktualizace
Jakmile identifikujete ID opravy operačního systému a ID aktualizace jádra (volitelné, protože většina časově aktualizovaného jádra se instaluje spolu s opravou operačního systému), pokračujte a vraťte aktualizaci jednu po druhé.
Jádro
Tento krok nelze použít, pokud bylo jádro nainstalováno spolu s opravou OS (yum update).
Použijte yum history undo s 3 pro vrácení aktivit (odstranění aktualizací jádra).
yum history undo 3
Výstup:
Last metadata expiration check: 1:24:58 ago on Wed 23 Oct 2019 05:19:07 AM EDT.
Undoing transaction 3, from Wed 23 Oct 2019 04:50:02 AM EDT
Install kernel-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
Install kernel-core-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
Install kernel-modules-4.18.0-80.11.2.el8_0.x86_64 @BaseOS
Dependencies resolved.
============================================================================================================================
Package Arch Version Repository Size
============================================================================================================================
Removing:
kernel x86_64 4.18.0-80.11.2.el8_0 @BaseOS 0
kernel-core x86_64 4.18.0-80.11.2.el8_0 @BaseOS 57 M
kernel-modules x86_64 4.18.0-80.11.2.el8_0 @BaseOS 19 M
Transaction Summary
============================================================================================================================
Remove 3 Packages
Freed space: 76 M
Is this ok [y/N]: Y << Press Y and Enter to revert Kernel
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : kernel-4.18.0-80.11.2.el8_0.x86_64 1/3
Running scriptlet: kernel-4.18.0-80.11.2.el8_0.x86_64 1/3
Erasing : kernel-modules-4.18.0-80.11.2.el8_0.x86_64 2/3
Running scriptlet: kernel-modules-4.18.0-80.11.2.el8_0.x86_64 2/3
Running scriptlet: kernel-core-4.18.0-80.11.2.el8_0.x86_64 3/3
Erasing : kernel-core-4.18.0-80.11.2.el8_0.x86_64 3/3
Running scriptlet: kernel-core-4.18.0-80.11.2.el8_0.x86_64 3/3
Verifying : kernel-4.18.0-80.11.2.el8_0.x86_64 1/3
Verifying : kernel-core-4.18.0-80.11.2.el8_0.x86_64 2/3
Verifying : kernel-modules-4.18.0-80.11.2.el8_0.x86_64 3/3
Removed:
kernel-4.18.0-80.11.2.el8_0.x86_64 kernel-core-4.18.0-80.11.2.el8_0.x86_64 kernel-modules-4.18.0-80.11.2.el8_0.x86_64
Complete!
Balíčky
Použijte yum history undo s 4 k vrácení aktivit (vrácení aktualizací OS).
yum history undo 4
Výstup:
Last metadata expiration check: 1:38:10 ago on Wed 23 Oct 2019 05:19:07 AM EDT.
Undoing transaction 4, from Wed 23 Oct 2019 04:57:30 AM EDT
Install grub2-tools-efi-1:2.02-66.el8_0.1.x86_64 @BaseOS
Upgrade bash-4.4.19-8.el8_0.x86_64 @BaseOS
Upgraded bash-4.4.19-7.el8.x86_64 @@System
Upgrade bind-export-libs-32:9.11.4-17.P2.el8_0.1.x86_64 @BaseOS
Upgraded bind-export-libs-32:9.11.4-16.P2.el8.x86_64 @@System
Upgrade grub2-common-1:2.02-66.el8_0.1.noarch @BaseOS
Upgraded grub2-common-1:2.02-66.el8.noarch @@System
Upgrade grub2-pc-1:2.02-66.el8_0.1.x86_64 @BaseOS
Upgraded grub2-pc-1:2.02-66.el8.x86_64 @@System
Upgrade grub2-pc-modules-1:2.02-66.el8_0.1.noarch @BaseOS
. . .
. . .
Upgrade epel-release-8-6.el8.noarch @epel
Upgraded epel-release-8-5.el8.noarch @@System
Dependencies resolved.
============================================================================================================================
Package Arch Version Repository Size
============================================================================================================================
Removing:
grub2-tools-efi x86_64 1:2.02-66.el8_0.1 @BaseOS 1.9 M
Downgrading:
bash x86_64 4.4.19-7.el8 BaseOS 1.5 M
bind-export-libs x86_64 32:9.11.4-16.P2.el8 BaseOS 1.1 M
grub2-common noarch 1:2.02-66.el8 BaseOS 880 k
grub2-pc x86_64 1:2.02-66.el8 BaseOS 35 k
grub2-pc-modules noarch 1:2.02-66.el8 BaseOS 899 k
. . .
. . .
systemd x86_64 239-13.el8 BaseOS 3.4 M
systemd-libs x86_64 239-13.el8 BaseOS 550 k
systemd-pam x86_64 239-13.el8 BaseOS 221 k
systemd-udev x86_64 239-13.el8 BaseOS 1.3 M
epel-release noarch 8-5.el8 extras 22 k
Transaction Summary
============================================================================================================================
Remove 1 Package
Downgrade 50 Packages
Total download size: 46 M
Is this ok [y/N]: Y << Press Y and Enter to Revert Updates
Downloading Packages:
(1/50): bash-4.4.19-7.el8.x86_64.rpm 966 kB/s | 1.5 MB 00:01
(2/50): grub2-common-2.02-66.el8.noarch.rpm 530 kB/s | 880 kB 00:01
(3/50): grub2-pc-2.02-66.el8.x86_64.rpm 537 kB/s | 35 kB 00:00
(4/50): bind-export-libs-9.11.4-16.P2.el8.x86_64.rpm 640 kB/s | 1.1 MB 00:01
(5/50): grub2-tools-2.02-66.el8.x86_64.rpm 3.7 MB/s | 1.9 MB 00:00
(6/50): grub2-pc-modules-2.02-66.el8.noarch.rpm 1.4 MB/s | 899 kB 00:00
(7/50): grub2-tools-minimal-2.02-66.el8.x86_64.rpm 2.0 MB/s | 196 kB 00:00
. . .
. . .
(46/50): systemd-pam-239-13.el8.x86_64.rpm 1.6 MB/s | 221 kB 00:00
(47/50): selinux-policy-targeted-3.14.1-61.el8.noarch.rpm 3.7 MB/s | 15 MB 00:04
(48/50): python3-libs-3.6.8-1.el8.0.1.x86_64.rpm 1.6 MB/s | 7.9 MB 00:04
(49/50): systemd-udev-239-13.el8.x86_64.rpm 1.7 MB/s | 1.3 MB 00:00
(50/50): epel-release-8-5.el8.noarch.rpm 77 kB/s | 22 kB 00:00
----------------------------------------------------------------------------------------------------------------------------
Total 4.1 MB/s | 46 MB 00:11
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: bash-4.4.19-7.el8.x86_64 1/1
Downgrading : bash-4.4.19-7.el8.x86_64 1/101
Running scriptlet: bash-4.4.19-7.el8.x86_64 1/101
Downgrading : platform-python-3.6.8-1.el8.0.1.x86_64 2/101
Running scriptlet: platform-python-3.6.8-1.el8.0.1.x86_64 2/101
Downgrading : python3-libs-3.6.8-1.el8.0.1.x86_64 3/101
Downgrading : grub2-common-1:2.02-66.el8.noarch 4/101
. . .
. . .
Verifying : epel-release-8-5.el8.noarch 99/101
Verifying : epel-release-8-6.el8.noarch 100/101
Verifying : grub2-tools-efi-1:2.02-66.el8_0.1.x86_64 101/101
Downgraded:
bash-4.4.19-7.el8.x86_64 bind-export-libs-32:9.11.4-16.P2.el8.x86_64
grub2-common-1:2.02-66.el8.noarch grub2-pc-1:2.02-66.el8.x86_64
grub2-pc-modules-1:2.02-66.el8.noarch grub2-tools-1:2.02-66.el8.x86_64
grub2-tools-extra-1:2.02-66.el8.x86_64 grub2-tools-minimal-1:2.02-66.el8.x86_64
initscripts-10.00.1-1.el8.x86_64 iptables-1.8.2-9.el8.x86_64
iptables-ebtables-1.8.2-9.el8.x86_64 iptables-libs-1.8.2-9.el8.x86_64
kernel-tools-4.18.0-80.el8.x86_64 kernel-tools-libs-4.18.0-80.el8.x86_64
kmod-25-11.el8.x86_64 kmod-libs-25-11.el8.x86_64
kpartx-0.7.8-7.el8.x86_64 libdnf-0.22.5-4.el8.x86_64
libnfsidmap-1:2.3.3-14.el8.x86_64 libsss_autofs-2.0.0-43.el8.x86_64
libsss_certmap-2.0.0-43.el8.x86_64 libsss_idmap-2.0.0-43.el8.x86_64
libsss_nss_idmap-2.0.0-43.el8.x86_64 libsss_sudo-2.0.0-43.el8.x86_64
microcode_ctl-4:20180807a-2.el8.x86_64 p11-kit-0.23.14-4.el8.x86_64
p11-kit-trust-0.23.14-4.el8.x86_64 platform-python-3.6.8-1.el8.0.1.x86_64
python3-hawkey-0.22.5-4.el8.x86_64 python3-libdnf-0.22.5-4.el8.x86_64
python3-libs-3.6.8-1.el8.0.1.x86_64 python3-perf-4.18.0-80.el8.x86_64
python3-rpm-4.14.2-9.el8.x86_64 rpm-4.14.2-9.el8.x86_64
rpm-build-libs-4.14.2-9.el8.x86_64 rpm-libs-4.14.2-9.el8.x86_64
rpm-plugin-selinux-4.14.2-9.el8.x86_64 rpm-plugin-systemd-inhibit-4.14.2-9.el8.x86_64
selinux-policy-3.14.1-61.el8.noarch selinux-policy-targeted-3.14.1-61.el8.noarch
setup-2.12.2-1.el8.noarch sssd-client-2.0.0-43.el8.x86_64
sssd-common-2.0.0-43.el8.x86_64 sssd-kcm-2.0.0-43.el8.x86_64
sssd-nfs-idmap-2.0.0-43.el8.x86_64 systemd-239-13.el8.x86_64
systemd-libs-239-13.el8.x86_64 systemd-pam-239-13.el8.x86_64
systemd-udev-239-13.el8.x86_64 epel-release-8-5.el8.noarch
Removed:
grub2-tools-efi-1:2.02-66.el8_0.1.x86_64
Complete! Restartujte systém.
reboot
Ověřit
Jádro
Je pravda, že systém je zaveden se starým jádrem pomocí níže uvedeného příkazu.
uname -a
Výstup:
Linux centos8.itzgeek.local 4.18.0-80.el8.x86_64 #1 SMP Tue Jun 4 09:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Balíčky
Porovnejte verzi balíčku a ujistěte se, že jsou balíčky downgradovány pomocí rpm -qa
Závěr
To je vše. Doufám, že vám tento příspěvek pomohl vrátit opravy OS na CentOS 8 / RHEL 8. Podělte se prosím o svůj názor v sekci komentářů.