How To Upgrade RedHat Using RHN

by Derek Vadala

Jason Kohles pointed out a neat trick on the RedHat Kickstart Mailing list yesterday. Apparently the redhat-release RPM is used by RHN to determine which version of RedHat you are running. Install a newer (meaning from a newer version of the distribution) version of redhat-release and RHN will think your system is horribly out of date and upgrade it.

For example let's say you're running RedHat 7.3 and you want to upgrade to 8.0:

  1. Download the redhat-release RPM from the 8.0 distribution tree. It's typically found here:

  2. Install the new version of redhat-release. You probably want to do something like rpm -Uhv redhat-release-8.0.8.noarch.rpm

  3. Now run up2date -p to let RHN know about your current system profile. RHN essentially gets a 7.3 package list but flags you as having an 8.0 system because of the new redhat-release package.

  4. Next, it's time to run the upgrade. That's done using up2date -u. Since there are lots of packages that need to be installed you might want run up2date -d before running up2date -u. This will download all the required packages first. After some time the upgrade will complete, and it's probably a good idea to reboot the system after everything has wrapped up.

  5. If you're using LILO, don't forget to run /sbin/lilo to rebuild your MBR before restarting.

I was able to sucessfully upgrade a few systems using this method, but as Jason pointed out, this is an unsupported feature and there have been reports of systems getting toasted. So try this at your own risk, you might have to perform some tedious repairs if something goes wrong!

Got any other Linux Administration tricks?


2003-02-26 18:47:46
danger will robinson
This may or may not work - if your computer explodes in a shower of white hot shrapnel, or turns translucent then fades away into Dimension Z, or becomes sentient and destroys all humans, don't complain to Red Hat.

If it works for you, it's a happy accident. Of course, it does work on occasion :)

2003-02-28 07:25:54
Why is a feature this useful undocumented and unsupported?
This is a great article, but to me it raises the more significant question of why such a useful feature as easily upgrading the system with up2date needs to be a "danger will robinson" hack.
Derek Vadala
2003-02-28 07:38:21
Why is a feature this useful undocumented and unsupported?
Perhaps having such a feature out in the open would dissaude people from purchasing boxed copies of RedHat. Even that doesn't make much sense to me, since you can always download the ISO file and perform an upgrade from CD without purchasing the boxed copy.

It's also possible that this type of upgrade was a lot more buggy in the past and that my luck with a 7.3 to 8.0 upgrade isn't that common. Or maybe jumping more than one version at a time will ruin your system and they have no way to prevent people from trying that.

2003-11-09 12:13:29
Wish I could get it to work
This is an awesome idea. However, I can't get into Redhat's FTP and they aren't allowing anonymous FTP these days apparently. Anybody know another way to get that release RPM? I do have a Redhat Network free account.
2003-11-09 12:24:16
RE: Wish I could get it to work
Whoops, disregard last question. I found that does have what I needed -- I got the 9 release, it's running now, getting the version 9 pkgs. I will try to remember to post how it went.