Upgrading Fedora to Newer Version with Yum

By Zhiqiang Ma On Nov 27, 2012

Please consider PreUpgrade for upgrading Fedora. This is the recommended method.


This post makes a list of actions should be done to upgrade Fedora using yum. Please note that this is for experienced users only, if you are not sure what you are doing and what do these commands mean, please stop here and read the manuals first, or go to Fedora’s Wiki about upgrading Fediora using yum.

This post aims to be a general method, although we use Fedora 15 to Fedora 16 as the example. We configure and install grub2 as the bootloader.

Clean Stuff

It is a good time to remove packages we don’t use. 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.
# package-cleanup --leaves
You can find orphaned packages (i.e. packages not in the repositories anymore). This will also show packages which have been partially uninstalled but where the “%postun” script failed.
# package-cleanup --orphans

Do the upgrade

Go to a text console and run in level 3

ctrl + alt + F2
init 3

Update yum first

yum update yum

Clean all cached meta data and packages

yum clean all

Import the key for the newer version’s repository

For Fedora 16, it is
rpm --import https://fedoraproject.org/static/A82BA4B7.txt

Synchronizes the installed package set with the latest packages available

yum --releasever=<releasenumberyouwanttosyncto> distro-sync
For upgrading Fedora 15 to Fedora 16:
yum --releasever=16 --disableplugin=presto  distro-sync
Double check the updated repositories after distro-sync
yum repolist

Update groups

yum groupupdate Base
List all other groups
yum grouplist
and also update them
yum groupupdate ALL GROUPS LISTED

Use grub2 instead of grub

Make configuration for grub2
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
Install grub2
/sbin/grub2-install BOOTDEVICE
For example, to install grub2 on sda:
/sbin/grub2-install /dev/sda

Reset services start/stop priorities

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

Reboot the system now

After reboot, you may see new kernel version on new Fedora version. For example, kernel 3.1.1 on Fedora 16
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.1.1-1.fc16.x8664 #1 SMP Fri Nov 11 21:47:56 UTC 2011 x8664 x8664 x8664 GNU/Linux

By: Zhiqiang Ma Last updated: Nov 27, 2012 Views: 984
Tags: , , , ,

About Zhiqiang Ma

Zhiqiang Ma is a PhD candidate at Dep. of CSE, HKUST. He is interested in system software for cloud computing, virtualization of large-scale distributed system, etc. Find Zhiqiang on Facebook, Twitter, LinkedIn and Google+.

Add your comments, share your thoughts

Be nice. Keep it clean. Stay on topic. No spam.