页面: 1
https://www.svennd.be/setup-auto-upgrade-on-centos-67/
缺省情况下,yum-cron一般并没有安装,需要先安装,然后启动服务
yum install yum-cron
chkconfig --level 345 yum-cron on
service yum-cron start
你可以修改/etc/sysconfig/yum-cron中的一些设置,
CHECK_ONLY=no (如果改成yes,表明只是检查是否有新的更新,并不实际安装)
DOWNLOAD_ONLY=no (如果改成yes, 表明检查更新并下载,但并不安装)
MAILTO= youremailaddress (这个地方要改成你自己的email)
Auto upgrade on Centos 6/7 using yum-cron
1) “update”
Seems so logically, but still update everything before you let yum-cron loose.
yum update 2) Install the magic
Its as easy as pie.
yum install yum-cron 3) configure
Configuration file for Centos 6 is located /etc/sysconfig/yum-cron for Centos 7 its located at /etc/yum/yum-cron.conf (a more logically location) Go through the settings, and decide whats best for you, personally I leave most as-if, only changing (Centos7) :
apply_updates = yes Since I want them installed nightly if available.
4) start the service & enable at reboot
# service yum-cron start
Redirecting to /bin/systemctl start yum-cron.service
# chkconfig yum-cron on
Note: Forwarding request to 'systemctl enable yum-cron.service'.
Enjoy ! From now on, your machine will be up-to-date… no more lagging behind! If an error should happen cause of updates, you only have to look back a few days in :
/var/log/yum.log
离线
页面: 1