Configuring yum to keep more than three kernels

When you run ‘yum update’ on your Fedora system, the default yum configuration will keep the last 3 kernels. This allows you to fail back to a previous working kernel if you encounter an error or a bug. The number of kernels to keep is controlled by the installonly_limit option, which is thoroughly described in the yum.conf(8) manual page:

installonly_limit Number of packages listed in installonlypkgs to keep installed at the same time. Setting to 0 disables this feature. Default is ‘0’. Note that this functionality used to be in the “installonlyn” plugin, where this option was altered via. tokeep. Note that as of version 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If that attribute is “keep”, then they will never be removed.

If you need to keep more than 3 kernels, you can increase the value of installonly_limit in /etc/yum.conf.

Purging the yum header and package cache

Most of the Linux distributions that utilize the yum package manager cache headers and packages by default. These files are cached in the directory identified by the cachedir option, which defaults to /var/cache/yum on all of the hosts I checked. On my Fedora 16 desktop this directory has grown to 167MB in size:

$ du -sh /var/cache/yum
167M /var/cache/yum

You can clean out the cached directory with the yum “clean” option:

$ yum clean all

If disk space is an issue on your systems, you can also set the “keepcache” option to 0. This will remove cached files after they are installed, as noted in yum.conf(8)the manual page:

keepcache Either `1' or `0'. Determines whether or not yum keeps
          the cache of headers and packages after successful installation.
          Default is '1' (keep files)

This is a useful option for hosts that have limited disk space. Nice!

Sudo insults — what a fun feature!

I think humor plays a big role in life, especially the life of a SysAdmin. This weekend I was cleaning up some sudoers files and came across a reference to the “insult” option in the documentation. Here is what the manual says:

insults If set, sudo will insult users when they enter an incorrect password. This flag is off by default.”

This of course peaked my curiosity, and the description in the online documentation got me wondering what kind of insults sudo would spit out. To test this feature out I compiled sudo with the complete set of insults:

$ ./configure –prefix=/usr/local –with-insults –with-all-insults

$ gmake

$ gmake install

To enable insults I added “Defaults insults” to my sudoers file. This resulted in me laughing myself silly:

$ sudo /bin/false

Password: 
Take a stress pill and think things over.
Password: 
This mission is too important for me to allow you to jeopardize it.
Password: 
I feel much better now.
sudo: 3 incorrect password attempts

$ sudo /bin/false

Password: 
Have you considered trying to match wits with a rutabaga?
Password: 
You speak an infinite deal of nothing
Password: 
You speak an infinite deal of nothing
sudo: 3 incorrect password attempts

Life without laughter is pretty much a useless life. You can quote me on that one! ;)