Tag Archives: rpm

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: 
  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.


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

Building pam_mount on CentOS 5 (RHEL)

huh? I can’t seem to find pam_mount for CentOS 5. RPMForge seems to have the build logs for it, but yum can’t see the rpm to install and neither can I.

Pretty simple to fix, a bit lazy, but it will only take you 5 minutes.

Grab the rpm sources for libHX and pam_mount from your local Fedora 9 mirror. I got mine from here:


Build the libHX source:

# rpmbuild --rebuild libHX-1.18-1.fc9.src.rpm

Install the libHX rpm and the libHX-devel rpm. Now build pam_mount the same way:

# rpmbuild --rebuild pam_mount-0.41-2.fc9.src.rpm

Use “yum localinstall” to install pam_mount as it probably needs to grab a perl XML module as well.