Karena sertifikasi aplikasi dan batasan lain dalam lingkungan produksi, mungkin lebih disukai untuk mengecualikan peningkatan RPM kernel (atau RPM tertentu lainnya) melalui pembaruan yum. Dalam hal ini kita dapat menggunakan plugin kunci versi YUM untuk mengecualikan paket/rpm tertentu agar tidak diperbarui.
Catatan :Contoh yang diberikan dalam posting adalah untuk mengecualikan paket kernel, tetapi metode yang sama juga berlaku untuk paket lain.Periksa paket kernel yang tersedia untuk upgrade.
# yum check-update kernel* Loaded plugins: fastestmirror, langpacks base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * extras: ftp.iitm.ac.in * updates: ftp.iitm.ac.in kernel.x86_64 3.10.0-693.2.2.el7 updates kernel-tools.x86_64 3.10.0-693.2.2.el7 updates kernel-tools-libs.x86_64 3.10.0-693.2.2.el7 updates
Tidak termasuk paket kernel
Untuk mengecualikan kernel agar tidak ditingkatkan melalui pembaruan YUM:
1. Instal plugin yum-versionlock:
# yum install -y yum-versionlock Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * extras: ftp.iitm.ac.in * updates: ftp.iitm.ac.in Resolving Dependencies --> Running transaction check ---> Package yum-plugin-versionlock.noarch 0:1.1.31-42.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================== Installing: yum-plugin-versionlock noarch 1.1.31-42.el7 base 32 k Transaction Summary ======================================================================================================================================================== Install 1 Package Total download size: 32 k Installed size: 45 k Downloading packages: warning: /var/cache/yum/x86_64/7/base/packages/yum-plugin-versionlock-1.1.31-42.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYA Public key for yum-plugin-versionlock-1.1.31-42.el7.noarch.rpm is not installed yum-plugin-versionlock-1.1.31-42.el7.noarch.rpm | 32 kB 00:00:08 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Importing GPG key 0xF4A80EB5: Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) [[email protected]]" Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 Package : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : yum-plugin-versionlock-1.1.31-42.el7.noarch 1/1 Verifying : yum-plugin-versionlock-1.1.31-42.el7.noarch 1/1 Installed: yum-plugin-versionlock.noarch 0:1.1.31-42.el7 Complete!
2. Pastikan yum plugin versionlock diaktifkan di /etc/yum/pluginconf.d/versionlock.conf mengajukan. Anda akan mencatat file bernama /etc/yum/pluginconf.d/versionlock.list terhadap parameter daftar kunci . File tersebut mencantumkan paket-paket yang akan dikecualikan dalam pembaruan yum.
# cat /etc/yum/pluginconf.d/versionlock.conf [main] enabled = 1 locklist = /etc/yum/pluginconf.d/versionlock.list # Uncomment this to lock out "upgrade via. obsoletes" etc. (slower) # follow_obsoletes = 1
3. Tambahkan RPM versi terkunci ke /etc/yum/pluginconf.d/versionlock.list .
# cat /etc/yum/pluginconf.d/versionlock.list kernel-3.10.0-693.2.2.el7
4. RPM yang versi lock tidak akan disertakan di update selanjutnya yup yo do. Verifikasi ini dengan menjalankan perintah check update lagi :
# yum check-update kernel* Loaded plugins: fastestmirror, langpacks, versionlock Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * extras: ftp.iitm.ac.in * updates: ftp.iitm.ac.in kernel-tools.x86_64 3.10.0-693.2.2.el7 updates kernel-tools-libs.x86_64 3.10.0-693.2.2.el7 updates