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:
Download the redhat-release RPM from the 8.0 distribution tree. It’s typically found here: ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/i386/RedHat/RPMS/
Install the new version of redhat-release. You probably want to do something like rpm -Uhv redhat-release-8.0.8.noarch.rpm
- 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.
- 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.
- 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?