Tips and Tricks
Featured Article: Using the Update Agent (up2date) from the command line
April 2003
You've heard it before. Real sys admins do it on the command line. That goes double for whiz-bang, web-based software management systems. But maybe you can have the best of both worlds. This month we take a look at Using the Update Agent (up2date) from the command line.
up2date is a complete system for managing and updating RPM packages on Red Hat Linux system. It has both command line and gui modes. For the purposes of this article, we'll assume that you're connected to the Internet and already have a Red Hat Network account:
[user@localhost user]$ up2date --register
Since we're covering the comand line, we assume you are running in text mode. If you are in the desktop environment and would like to follow along in a terminal, just add –nox to the following commands.
You can change any of the default configuration settings, such as which packages to ignore, enabling package rolbacks with 'up2date-config'.
This will produce a list with current settings. Type the number of any setting you wish to change. For example:
[user@localhost user]$ up2date-config 0. debug No 1. rhnuuid 38e8d384-589b-11d7-9124-00096be0a8c5 2. isatty Yes 3. showAvailablePacka No 4. depslist [ ] 5. networkSetup Yes 6. retrieveOnly No 7. enableRollbacks No 8.pkgSkipList ['kernel*'] 9.storageDir /var/spool/up2date ... 31. httpProxy 32. headerCacheSize 40 33. forceInstall No 34. noReboot No
Enter number of item to edit <return to exit, q to quit without saving>:
You would type '7', then 'Yes', then [enter] to enable rollbacks. Or you could type '8', and add mozilla*; to the list, or remove the kernel* packages.
You might want to just update a particular package for now and wait on any others:
[user@localhost user]$ up2date mozilla
This will just grab and install newer Mozilla packages.
Let's say you want to update everything you have available and automatically resolve dependencies. Just type:
[user@localhost user]$ up2date -u (or –update)
You can download the packages without installing them:
[user@localhost user]$ up2date -d (or –download)
This will put the packages in /var/spool/up2date (or whatever you specify in 'up2date-config', line 9.)
If you just want to check for available updates and test:
[user@localhost user]$ up2date –nodownload
Add a '--dry-run' and you will see an output of all available downloads with dependencies.
You may keep a local directory of packages yourself. You can ask up2date to look for these first:
[user@localhost user]$ up2date -k (or –packagedir)
This will be followed by a colon delimited list of directory paths to check before attempting to download newer ones.
Find out what channel(s) you are currently subscribed to with:
[user@localhost user]$ up2date –show-channels
And install everything from a particular channel with:
[user@localhost user]$ up2date –install-all –channel channel_name
Up2date can even tell you packages that are installed but that aren't in any channel:
[user@localhost user]$ up2date –show-orphans
There are of course other things you can do with up2date from the command line. Type 'up2date -h' or 'man up2date' and see for yourself.
Next month, we'll get further into the joys of the Red Hat Network with a look at the Update Agent gui.



