
572
|
Chapter 5: Package Management
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
If you want to update your system daily, to keep it current and to be sure you
have the latest security fixes, you can set up a command that you can reissue every
day, or you can set it up as a cron job to run overnight. (See the descriptions of
the cron and crontab commands in Chapter 3 for more information on setting up
a cron job.)
For example, with apt-get, you can set up the command:
apt-get update && apt-get -u dist-upgrade
This command runs apt-get twice: first to update the local package lists, and then
to actually do the upgrade. The dist-upgrade command handles all dependencies
when it does the upgrade, and the -u option prints a list of the packages being
upgraded.
yum, on the other hand, comes with a cron job that can be run daily. This job first
updates yum itself, then updates all the remaining packages:
#!/bin/sh
if [ -f /var/lock/subsys/yum ]; then
/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi
The -R option sets a maximum time, in minutes, for yum to wait before running
the command, -e sets the error level to 0 to print only critical errors, -d specifies a
debug level of 0 to print no debugging messages, and -y assumes “yes” as the
answer to any questions.
The Red Hat Package Manager
The Red Hat Package ...