The automatic security updates are great – the most important security patches are delivered very soon after release. You can find tons of tutorials how to enable them on CentOS with Yum Cron – but almost all of them are wrong!
The problem is the CentOS repository doesn’t contain the metadata about security updates (updateinfo.xml) – it is available only for RHEL under their subscription (Scientific Linux has these metadata too). So you are able to install yum-cron, but it doesn’t work with other configuration than “default” (= update all packages with yum upgrade). Some repositories (e.g. EPEL) do contain the security metadata, so it seems that yum-cron is working, but it is only a false sense of security because there can be hundreds of invisible security updates available.
Fortunately there are few ways to enable them properly. They are usually based on the great CEFS (CentOS Errata for Spacewalk) by Steve Maier who parses CentOS-Announce Archives and generates the feed for SpaceWalk from them. You have several options how to use them:
- Use SpaceWalk (obviously) – but it is a very fat system management solution.
- Make your own copy of Centos Updates Repo (it has around 2GB) and add updateinfo with generate_updateinfo script by VMFarms.
- Use the centos-package-cron to notify + update manually or pipe the output to yum.
- Use the security scanner e.g. Vuls (I like it!).
- Use a ready made repo 🙂
The ways 1 – 4 are described in the following post. If you want to run your own repo (option 2), you need to do following steps:
- download CEFS feed
- generate updateinfo.xml
- sync the current CentOS updates
- create local CentOS repository
- add updateinfo.xml into local repository
wget -q -N -P /repo/cefs http://cefs.steve-meier.de/errata.latest.xml python generate_updateinfo.py -s all -t all /repo/cefs/errata.latest.xml -d /repo/ reposync -g -l -d -m --repoid=updates --newest-only --download-metadata --download_path=/repo/centos createrepo /repo/centos modifyrepo /repo/updateinfo-7/updateinfo.xml /repo/centos/updates/repodata/
However, the quickest and easiest way is no. 5 – to use Steve’s ready made repository. If you want to use his repo, you need to follow him on Patreon for symbolic $1 per month – you will get a great value for your money! Maybe you will be unpleasantly suprised how many important updates you have missed 🙂