Note that the commands above fall into three broad categories: informational command, installation commands, and update commands. The first two are almost always run interactively. yum update needs to be run regularly and hence needs to be automated. The yum rpm recognizes this by installing /etc/cron.daily/yum.cron and /etc/init.d/yum. The former is a script that runs yum update. The latter is a control structure that permits this action to be controlled via chkconfig.
Yum may have been installed on your system with the nightly cron already enabled by (for example) a departmental or institutional administrator who repackaged yum with a local /etc/yum.conf that points to a local set of repositories. At Duke, for example, any Linux system installed from the campus repository already contains yum as part of its Basic package. Yum itself is pre-configured to both update and install future RPMs from the same repository as the original system install and to update the system to the latest RPMs placed on that repository every night.
This makes the campus security officer very happy, as an exploit can be discovered in a Linux package in the morning, a patched RPM that closes the exploit can be dropped into the repository at five in the afternoon, and every Linux system on campus will be updated to the patched package and secure again by the following morning. It also makes the non-expert users of these systems very happy, as if they report a bug or problem that can be easily patched and the relevant RPM updated and dropped back into the repository, they can do ``nothing'' and the problem is resolved the next day, even though the central repository administrator may have no direct access to their systems at all.
If you are using yum in a similar context inside an organization that maintains a repository and pre-configured yum to use this repository according to some policy, it is likely wise to leave the setting alone (or at least find out what the policy is before changing it). If you are a systems administrator seeking to create such a setup for your organization, hopefully this document is sufficient for you to see how to go about it (further help is available on the yum list if this is not correct).
If you are an ordinary user seeking to set up automated maintenance from a public repository, then after you have set things up according to the general instructions above so that a yum update reports that all packages are installed and the latest version, you will likely want to turn on the nightly cron update. Simply become root and enter:
# chkconfig yum on # /etc/init.d/yum start(where the latter is necessary the first time, as chkconfig does not start services as they are turned on). On all subsequent reboots the yum nightly cron will be automatically enabled at boot time.
It is worthwhile to look over the nightly cron script in /etc/cron.daily/yum.cron. As of this moment, it contains:
#!/bin/sh if [ -f /var/lock/subsys/yum ]; then /usr/bin/yum -R 10 -e 0 -d 1 -y update yum /usr/bin/yum -R 120 -e 0 -d 1 -y update fiNote that this tells yum to first update yum, then update everything else (a wise order to follow, as one doesn't want yum's guts to be replaced in midstream). The -R window option causes yum to wait a random amount of seconds in the window and then run - this causes the server load associated with e.g. an entire campus of updates running out of cron at the same time to be spread out in time a bit. Systems administrators or users may wish to tweak these settings a bit for their local environment or according to the policy dictates of the public repositories they are using.