測試安全補丁升級, 不升級內核版本
CentOS/RHEL 6
開始升級所有軟件的安全補丁:
yum -y --security upgrade
自動更新安全補丁
yum -y install yum-cron
vim /etc/sysconfig/yum-cron
CHECK_ONLY=yes 不要安裝,只做檢查(有效值: yes|no)
CHECK_FIRST=yes 不要安裝,只做檢查和下載(有效值: yes|no)
DOWNLOAD_ONLY=yes 先要檢查補丁需要後下載
開機自動啟動, 每晚自動更新
service yum-cron start
chkconfig yum-cron on
uname -a 查看內核版本
more /etc/issue 查看系統信息
操作過程如下:
[root@localhost ~]# yum -y --security upgrade
Loaded plugins: fastestmirror, security
Setting up Upgrade Process
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 30 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 7.0 MB 00:00
Resolving Dependencies
Limiting packages to security relevant ones
No packages needed for security; 159 packages available
[root@localhost ~]# yum -y install yum-cron
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
* base: mirror.sunnyvision.com
* extras: mirror.sunnyvision.com
* updates: mirror.sunnyvision.com
Resolving Dependencies
--> Running transaction check
---> Package yum-cron.noarch 0:3.2.29-81.el6.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
yum-cron noarch 3.2.29-81.el6.centos base 46 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 46 k
Installed size: 28 k
Downloading Packages:
yum-cron-3.2.29-81.el6.centos.noarch.rpm | 46 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>
Package: centos-release-6-8.el6.centos.12.3.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : yum-cron-3.2.29-81.el6.centos.noarch 1/1
Verifying : yum-cron-3.2.29-81.el6.centos.noarch 1/1
Installed:
yum-cron.noarch 0:3.2.29-81.el6.centos
Complete!
[root@localhost ~]# vim /etc/sysconfig/yum-cron
[root@localhost ~]# service yum-cron start
Enabling nightly yum update: [ OK ]
[root@localhost ~]# chkconfig yum-cron on
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# more /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m
測試安全補丁升級, 不升級內核版本