Adeptus-Mechanicus

Main
Codex
Librarium Whitehat
Advisories
Blog Pics
"Inveniam viam aut faciam" : I will either find a way, or I shall make one


THE YUM COMMAND - MANAGE PACKAGES EASIER

The yum utility is a great way for those people who use rpm package based systems to manage their systems package trees. It stands for "YellowDog Updater Modified" and can be found in source form at it's home page. Not only does it have the normal package management features, but more importantly it deals with dependencies, works with multiple sites, checks package signatures and can be easily scripted to perform updates and maintenance.


Using yum
Once you have yum installed using it is very simple..

yum check-update checks for updates but does not do anything
yum update <package name> check for and updates package interactively
yum update checks for and updates all packages interactively
yum -y update <package name>
checks for and updates package name automatically
yum -y update
checks for and updates all packages automatically
yum list list all packages ready to be installed
yum list updates list all packages ready to be updated
yum list installed list all packages currently installed on system
yum info <package name> gives you information about package
yum install <package name> install package name interactively
yum -y install <package name>
install package name automatically
yum remove <package name> removes package name interactively
yum -y remove <package name> removes package name automatically
yum clean cleans all packages and headers

Getting the Most from yum
There are a couple of things you can do with yum to help make your life safer and easier. One of the first things you can do is check your yum.conf file and make sure that the option "gpgcheck=1" is in all your sections but the main one, this will make sure that yum checks the package signatures as it works. After installation the first command you will properly want to run, in order to get the headers and check which packages need to be updated, will be..
 yum check-update

For ongoing maintenance your will properly want to automate patches, for this you can use a cron entry like..
0 3 * * * yum -y update

Next you will properly want to automate cleaning up the files yum uses, here you can also use a cron entry..
0 3 1 * * yum -y clean

Lastly, yum is very handy for hardening your linux system by removing all the packages you do not need. You can use the..
yum remove <package name>

to remove all the packages you do not need on your system, remember that you should only have what you need on your server, try to remove all the excess applications from your system.

Proxy Usage
One interesting little gotcha, is that if the server you are 'yumming' from is sitting behind a proxy then you need to do something like this before starting the yum process..
export http_proxy=http://<username>:<password>@<proxy-address>:<proxy-port-number>

That should sort out your connections hassles. If this is a common occurence consider making it a permanent addition to your profile settings.

Final Words
Go ahead and give yum a try, it is a very handy tool and can help make your life a lot easier if you do use a rpm package linux distribution. As always have fun and learn.