GNU/Linux >> Belajar Linux >  >> Cent OS

Cara Mengembalikan Patch OS Pada CentOS 8 / RHEL 8

Di posting sebelumnya, kami melihat cara memperbarui sistem CentOS 8 / RHEL 8 untuk mendapatkan pembaruan terbaru di sistem Anda. Jarang, pembaruan dapat merusak sistem atau aplikasi Anda yang berjalan di atasnya.

Dalam hal ini, Anda mungkin perlu mengembalikan paket yang diperbarui ke versi sebelumnya.

Dalam posting ini, kita akan melihat langkah-langkah untuk mengembalikan patching OS pada CentOS 8 / RHEL 8.

Riwayat Pembaruan

Perintah yum history akan mencantumkan semua aktivitas yang Anda lakukan dengan perintah yum, termasuk patching OS.

yum history

Dari output di atas, Anda dapat melihat

ID 4 :Penambalan OS (Baris perintah:perbarui) sebagaimana adanya (I) nstall dan (U) pdate tindakan dari 55 paket.

ID 3 :Pembaruan kernel (Baris perintah:update -y kernel) (I) nstall aksi 3 paket

Anda juga dapat mengetahui paket apa saja yang diperbarui selama ID riwayat 4 atau 3 dengan perintah di bawah ini.

Saya sedang memeriksa informasi ID riwayat 3.

yum history info 3

Keluaran:

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

Demikian juga, Anda dapat melihat informasi ID lain.

Kembalikan Pembaruan

Setelah Anda mengidentifikasi ID patch OS dan ID pembaruan Kernel (Opsional karena sebagian besar waktu yang diperbarui Kernel diinstal bersama dengan patch OS), silakan lanjutkan untuk mengembalikan pembaruan satu per satu.

Kernel

Langkah ini tidak berlaku jika Kernel diinstal bersama dengan patch OS (yum update).

Gunakan yum history undo dengan 3 untuk mengembalikan aktivitas (hapus pembaruan kernel).

yum history undo 3

Keluaran:

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!

Paket

Gunakan yum history undo dengan 4 untuk mengembalikan aktivitas (kembalikan pembaruan OS).

yum history undo 4

Keluaran:

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!

Mulai ulang sistem.

reboot

Verifikasi

Kernel

Sangat bahwa sistem di-boot dengan kernel lama menggunakan perintah di bawah ini.

uname -a

Keluaran:

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

Paket

Bandingkan versi paket dan pastikan paket diturunkan dengan rpm -qa .

Kesimpulan

Itu saja. Saya harap posting ini membantu Anda mengembalikan patch OS pada CentOS 8 / RHEL 8. Silakan bagikan tanggapan Anda di bagian komentar.


Cent OS
  1. Cara menginstal phpMyAdmin di RHEL 8 / CentOS 8

  2. Cara Menginstal P7Zip di RHEL 8 / CentOS 8

  3. Cara menginstal VMware Workstation 8 di CentOS 6 / RHEL 6 (x86_64)

  1. Cara menginstal ntfs-3g di RHEL 8 / CentOS 8

  2. Cara Menginstal PHP-mbstring di RHEL 8 / CentOS 8

  3. Cara menginstal phantomjs di RHEL 8 / CentOS 8

  1. Cara menginstal Dropbox di RHEL 8 / CentOS 8

  2. Cara memasang kompas di RHEL 8 / CentOS 8

  3. Cara Memasang Wayang di RHEL 8 / CentOS 8