rhel and the importance of curl

So, I was doing some experimentation with Puppet on Redhat Enterprise system (Release 5 to be specific) and as part of that I wanted to make sure that among other things Curl was installed via Yum. Turns out that curl is needed by Yum and when I removed it I broke yum. Here is what I did to get the system back and running.

Since I have other RHEL systems available I jumped on one just like the one I broke. Yum can be used to download packages if you have the right plugin available.

yum install yum-downloadonly

At this point the packages can be downloaded. Interestingly it will not work specifying install or upgrade to yum if the packages are already installend and current. Fortunately reinstall works

mkdir fix
cd fix
yum --downloadonly --downloaddir=. reinstall curl libcurl yum-rhn-plugin rhn-check \
rhn-setup rhnsd gnupg rhn-client-tools

After that all that is left is to scp the files to the broken host and install them.

rsync -ravz good-host:fix .
cd fix
rpm -ivh *.rpm

You might have two versions of curl, which could cause an error. If that happens just get rid of the one that doesn't match the architecture.