This page contains information explaining how to upgrade Fedora using yum
.
Upgrading Fedora using yum directly
When upgrading with yum you don't get any help from FedUp or Anaconda, but with a typical system it might be able to upgrade systems remotely over ssh and with limited downtime. (You will still need to reboot to get the new kernel and system libraries/services running).
A live upgrade with yum usually works well with a typical installation and when following the advice below.
Participate
If you are upgrading using Yum and it shows any general dependency issues, please file them in http://bugzilla.redhat.com. But please read this page, all references pages and search the mailing list archives before filing bugs. And of course, please help keep this page updated.
If you want to help make live upgrades work smoothly, join the Live Upgrade Special Interest Group.
Instructions to upgrade using yum
1. Backup your system
Backup any personal data to an external hard drive or to another machine. If there is some unrecoverable error that requires a fresh install, you don't want to lose any data.
2. Read about common problems
Further down in this page there is a list of common problems specific to yum upgrades for specific versions. Some of them require attention before the upgrade.
General advice on upgrading Fedora can be found on the Upgrading page. You should also read the Installation Guide and Release Notes for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of Common bugs.
3. Clean Stuff
Review and remove all .rpmsave and .rpmnew files before and after upgrading. (And if you have selinux enabled then remember to check security context if you move config files around.)
Now is a good time to remove packages you don't use - especially non-standard packages.
4. Do the upgrade
If you have 3rd party repositories configured, you may need to adjust them for the new Fedora version. If you switch from one Fedora release to another there is often nothing that needs to be done. If you switch to Rawhide from a standard Fedora release (or vice versa) then most of the time you will need to install the Rawhide release RPMs from the 3rd party repository as well (or the standard ones, if switching back).
Note that the upgrade is likely to fail if there are outdated dependencies from packages not backed by a yum repository or backed by a repository which isn't ready for the new version.
It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then
fedora-upgrade
A small script named fedora-upgrade is available which aims to automate the process outlined below. To run it, do the following
$ sudo yum install fedora-upgrade $ sudo fedora-upgrade
Alternatively, follow the manual steps:
Go to a text console
ctrl + alt + F2
(or)
log in as root, and go into runlevel 3
init 3
Update yum to latest version available in your Fedora version
# yum update yum
Install the new fedora gpg key for the version you are updating to
Keys you may find and verify at
https://fedoraproject.org/keys
or see a version specific update instructions at the bottom.
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=<release_number_you_want_to_sync_to> distro-sync
Note: While it is recommended to upgrade to intermediate releases if upgrading from an older release (for example upgrading from Fedora 12 to 13, then 13 to 14), depending on what version you are upgrading from, this step may fail with an error about GPG keys being in the wrong format. To overcome this, you can add the "--nogpgcheck" switch to the above yum distro-sync command.
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 'Minimal Install'
You might want to update other groups too, see
# yum grouplist
For example
# yum groupupdate "GNOME Desktop" \ "Development Tools" "Sound and Video" \ "Games and Entertainment" "Administration Tools" \ "Office/Productivity" "System Tools"
6. Preparing for reboot
Before booting you should usually install the bootloader from your new grub by running
/usr/sbin/grub2-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 /usr/sbin/grub2-install --recheck /dev/sda).
It might also be necessary to update the grub config file:
cp --backup=numbered -a /boot/grub2/grub.cfg{,.bak} # create backup copy /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg # update config file
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 [ -x $f ] && /sbin/chkconfig $f resetpriorities; done
Again, run package-cleanup --orphans
to find packages that haven't been upgraded.
Version specific notes
From pre-release
If you are upgrading to a final release from an alpha, beta, preview, or other Rawhide release, please see Upgrading from pre-release to final.
To rawhide
See the Rawhide release page for more information on Rawhide.
# yum install fedora-release-rawhide yum-utils # yum-config-manager --disable fedora updates updates-testing # yum-config-manager --enable rawhide # yum update yum # yum --releasever=rawhide distro-sync --nogpgcheck
If you are upgrading from 41 or later, replace the first command with yum install fedora-release-rawhide yum-utils
.
Fedora 20 -> Fedora 21
# rpm --import https://fedoraproject.org/static/95A43F54.txt # yum update yum # yum clean all # yum --releasever=21 distro-sync
Fedora 21 split into different products. Execute one of those commands:
# yum install system-release-workstation # yum install system-release-cloud # yum install system-release-server
or this one if you want to have non-productized Fedora
# yum install system-release-nonproduct
If you change your mind, you can easily switch between products.
# yum swap system-release-cloud system-release-workstation
Swapping to workstation sometimes may require you to use yum shell
as it may require multiple packages to be swapped.
Many people report (e.g. bugs 1035326, 1044184, 1002331) that after upgrade some files have incorect SELinux context. It is recommend to run:
# restorecon -R /
Fedora 19 -> Fedora 20
Install the new Fedora 20 gpg key and upgrade:
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-$(uname -i) # yum update yum # yum clean all # yum --releasever=20 distro-sync
Fedora 18 -> Fedora 19
Install the new Fedora 19 gpg key and upgrade:
# rpm --import https://fedoraproject.org/static/FB4B18E6.txt # yum update yum # yum clean all # yum --releasever=19 distro-sync
If you use Fedora ARM, run these commands instead:
# rpm --import https://fedoraproject.org/static/BA094068.txt # yum update yum # yum clean all # yum --releasever=19 distro-sync
Fedora 17 -> Fedora 18
Note: One user has reported problems trying to upgrade an Intel Mac UEFI installation using this method, including the manual bootloader migration. Read more
- Install the new Fedora 18 gpg key:
su -c 'rpm --import https://fedoraproject.org/static/DE7F38BD.txt'
- If you are using SELinux in Enforcing mode, make sure your selinux-policy is up to date:
su -c 'yum update selinux-policy'
- Upgrade all packages:
su -c 'yum update yum'
su -c 'yum clean all'
su -c 'yum --releasever=18 --disableplugin=presto distro-sync'
It is recommended that updates be enabled for this step, for best results.
- Rebuild rpm database:
su -c 'rpm --rebuilddb'
, or rpm -qa will not work due to an upgrade of rpm
If you used an outdated selinux-policy
package in Enforcing mode during the upgrade, you may notice errors in the yum output when several packages attempt to create users and/or groups, and after the upgrade you may have problems related to these packages, including issues with logging in via GDM (you may just see a spinning cursor) and/or performing actions requiring administrative privileges. This is a result of bug #844167. If you have this problem, you should re-install the affected packages with su -c 'yum reinstall (packagenames)'
, and then reboot. Affected packages may include libvirt-daemon and polkit: su -c 'yum reinstall libvirt-daemon polkit'
Due to Features/DisplayManagerRework, the upgrade may leave you without a display manager enabled. To solve this problem, use su -c 'systemctl enable yourdm.service'
, replacing yourdm with the display manager you intend to use, e.g. gdm
or kdm
.