Tag Archives: redhat

Re-installing with yum

I recently had a problem where a yum update broke things because of my umask setting, I needed to reinstall the packages.

Yum doesn’t have a reinstall feature, and I didn’t want to do a remove first, the packages were currently in use. So how to do a reinstall?

Remove the package from the RPM database without actually removing it:
# rpm -e --justdb --nodeps "package name"

The package is still installed but when yum queries the RPM DB it will find it missing and allow you to install it:
# yum install "package name"

RPM rollbacks?

I really should read man pages. I had no idea that rpm could do rollbacks with just a couple of config changes, and that it was supported in yum.

This would have come in really handy last week. I upgraded an out of date file server and the latest samba broke Directory authentication, which was not cool and file shares cold not be authenticated until the problem was solved. CentOS do not keep old packages in their repos. I had to compile a FC6 version of samba to rollback to a working state until I investigated and found a patch.

The bug is dated May, the patch has been out for months, and the fix is still not in official repos.

Anyway back to rollbacks, 2 steps:

  1. In /etc/yum.conf add the line: 
    tsflags=repackage
  2. In /etc/rpm/macos (create it if it does not exist), add the line:
    %_repackage_all_erasures 1

Now if the update or install clobbers something, you can roll back packages to their former state just with a simple rpm command.

Examples:

rpm -Uhv –rollback ‘9:00 am’,
rpm -Uhv –rollback ‘4 hours ago’,
rpm -Uhv –rollback ‘december 25′.

NFS4, Kerberos, NTP and Redhat

My latest lab build is using nfs4 to mount home directories.

Kerberos authentication requires the time to synced before it will work. Redhat (CentOS) tries mounting Network filesystems before syncing the time on startup. Can anyone else see the problem?

If any of our lab machines have their time out by more than 5 minutes the mount will fail.

I have changed the startup priority of ntpd from 58 to 12, and this has fixed the problem.

As ntpd only requires networking to work, I cannot understand why it starts at 58, but problem solved.