Fedora Upgrade Using Yum

System Upgrade With YUM

Upgrading your Fedora, or other RPM based system using YUM is fairly simple. Once you follow a few basic commands your system will automatically upgrade to the latest release.

1. Back up your system

Use rsync, an external drive, back up to the cloud or any other means you have available to protect your precious data.

2. Clean Stuff

Find unused config files
Merge and resolve the changes found by the following script: yum install rpmconf; rpmconf -a Now find and remove old config which nobody owns: find /etc /var -name '*.rpm?*'

Now is a good time to remove packages you don't use - especially non-standard packages.

3. Find and review "unused" packages

You can find packages not required by other packages with the tool package-cleanup from the yum-utils package: yum install yum-utils; package-cleanup --leaves. These packages could be candidates for removal, but check to see whether you use them directly or if they are used by applications not backed by rpm packages. Remove them with yum remove package-name-and-version.
Another useful tool for cleaning up unused packages is rpmreaper. It's an ncurses application that lets you view rpm dependency graph and mark packages for deletion. Marking one package can make other packages leaf, which you can see immediately, so you don't have to run the tool several times to get rid of whole sub-tree of unused packages. Install with: yum install rpmreaper.

Find and review "lost" packages
You can find orphaned packages (ie packages not in the repositories anymore) with: package-cleanup --orphans. This will also show packages which have been partially uninstalled but where the "%postun" script failed.

4. Start the upgrade

Go to a text console
ctrl + alt + F2

log in as root, and go into runlevel 3

init 3

Update yum to latest version available in your Fedora version
yum update yum

Clean the cache
Then remove all traces of the version you are leaving from the yum cache in /var/cache/yum.

yum clean all

Upgrade all packages

yum --releasever= distro-sync

5. Make sure Fedora is upgraded

Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well. Confirm with
 yum repolist

after the upgrade process is over. yum might complain about conflicts or requirements. That is probably because you have used non-standard repositories or installed non-standard packages manually. Try to guess which packages cause the problem (or at least is a part of the dependency chain) - uninstall them and try again. Remember to install the packages again if they are essential.
Ensure that all (new) essential packages from the new version are installed with

yum groupupdate Base

You might want to update other groups too, see

yum grouplist
For example

yum groupupdate "GNOME Desktop Environment" \
"Development Tools" "Server Configuration Tools" \
"Hardware Support" "Sound and Video" \
"Graphical Internet" "Fonts" \
"Games and Entertainment" "Printing Software" \
"Administration Tools" "Office/Productivity" "System Tools"

6. Preparing for reboot

Before booting you should usually install the bootloader from your new grub by running

/sbin/grub-install BOOTDEVICE
- where BOOTDEVICE is usually /dev/sda (If you get an error '/dev/sda does not have any corresponding BIOS drive' from that, then try /sbin/grub-install --recheck /dev/sda.)

Also, the order of init scripts could have changed from the previous version. A command to reset the order is:

cd /etc/rc.d/init.d; for f in *; do /sbin/chkconfig $f resetpriorities; done

Again, run package-cleanup --orphans to find packages that haven't been upgraded.

That's about it!