Tuesday, February 15, 2011

Upgrading a Fedora Install

After making a right mess of things installing some new packages, I decided to do an offline upgrade of my Fedora 11 server to Fedora 14, and I hit a few snags along the way that I'll detail.

First off, as you may or may not know, you can only upgrade to two versions ahead. So to get from 11 to 14, I had to go first from 11 to 13 and then from 13 to 14. This isn't a big deal, but it will add some time to your upgrade process! Just make sure you have both dvd's handy.

An interesting issue I ran into is that despite upgrading, I still had many, many fc11 packages still installed, and what's more, they were preventing me from upgrading or installing new packages via yum for fc14! There are some commands that can make this easy to clean up, though. Note: If you're upgrading one release ahead, i.e. fc13 -> fc14 it can be completely normal to see fc13 packages since some packages don't get updated right away.

That said, there is a handy little command that lets you find orphaned packages installed on your system, that is, packages which are no longer in any repository your system looks at. (Note: This also includes any programs which you got from outside your repositories -- Handbrake for example, or Subsonic.) This command is:
  • package-cleanup --orphans
If there are only a few items that are put out from this you can do a clean up manually, I chose to remove packages with the following command:
  • rpm -e --nodeps <package name>
-e tells rpm to remove the package and --nodeps means to remove only the package, not other packages that depends on it.

I had over 100 fc11 packages leftover, so I used this little bash loop to get rid of them:
  • for i in `sudo package-cleanup --orphans | grep fc11`; do sudo rpm -e --nodeps $i; done
The grep fc11 above will strip out the beginning lines (loading plugins, extra repo's, etc) which are not valid package names, as well strip out packages which are release independent (again things like Handbrake, Subsonic, etc).

Even after doing the above when installing packages via yum I was getting error messages (though my installs would still go through) about certain packages missing dependencies. The only solution I could find for this was to patiently look up the libraries (most of the errors were about .so files) on google and find out which packages they belonged to and then run a yum install for said package. It took about 5-10 packages before the errors finally cleared up.

Something else worthy of noting is that I hit some major weirdness / disruptiveness in my perl install. I had to upgrade all my perl packages after the upgrade manually via yum. The main issue, however, is that namespace, namespace::clean, and namespace::autoclean were not installed and this led to all sorts of issues attempting to run scripts which depended explicitly on namespace and also attempting to install and compile packages via CPAN.

So be prepared to deal with a little work when attempting to do a Fedora upgrade (especially from three releases back!) but on the whole I'd say it was less effort to get all this done than to do a new install from scratch as it saved me from having to worry about saving off all my custom software, scripts, configs, and then restoring these afterward.

No comments:

Post a Comment

Followers