Upgrading Fedora using yum

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(BZ link clickable)
(update rawhide instructions for fedora-repos-rawhide)
 
(14 intermediate revisions by 9 users not shown)
Line 62: Line 62:
 
A small script named fedora-upgrade is available which aims to automate the process outlined below. To run it, do the following
 
A small script named fedora-upgrade is available which aims to automate the process outlined below. To run it, do the following
  
<pre> sudo yum install fedora-upgrade  
+
<pre>$ sudo yum install fedora-upgrade  
sudo fedora-upgrade
+
$ sudo fedora-upgrade
 
</pre>
 
</pre>
  
Line 86: Line 86:
  
 
<pre>
 
<pre>
yum update yum
+
# yum update yum
 
</pre>
 
</pre>
  
Line 102: Line 102:
  
 
<pre>
 
<pre>
yum clean all
+
# yum clean all
 
</pre>
 
</pre>
  
Line 110: Line 110:
  
 
<pre>
 
<pre>
yum --releasever=<release_number_you_want_to_sync_to> distro-sync
+
# yum --releasever=<release_number_you_want_to_sync_to> distro-sync
 
</pre>
 
</pre>
  
Line 125: Line 125:
  
 
<pre>
 
<pre>
yum groupupdate 'Minimal Install'
+
# yum groupupdate 'Minimal Install'
 
</pre>
 
</pre>
  
Line 131: Line 131:
  
 
<pre>
 
<pre>
yum grouplist
+
# yum grouplist
 
</pre>
 
</pre>
  
Line 137: Line 137:
  
 
<pre>
 
<pre>
yum groupupdate "GNOME Desktop" \
+
# yum groupupdate "GNOME Desktop" \
  "Development Tools" "Sound and Video" \
+
    "Development Tools" "Sound and Video" \
  "Games and Entertainment" "Administration Tools" \
+
    "Games and Entertainment" "Administration Tools" \
  "Office/Productivity" "System Tools"
+
    "Office/Productivity" "System Tools"
 
</pre>
 
</pre>
  
Line 149: Line 149:
 
Before booting you should usually install the bootloader from your new grub by running
 
Before booting you should usually install the bootloader from your new grub by running
 
<pre>
 
<pre>
/sbin/grub-install BOOTDEVICE
+
/usr/sbin/grub2-install BOOTDEVICE
 +
</pre>
 +
- where BOOTDEVICE is usually <code>/dev/sda</code> (If you get an error '/dev/sda does not have any corresponding BIOS drive' from that, then try <tt>/usr/sbin/grub2-install --recheck /dev/sda</tt>).
 +
 
 +
It might also be necessary to update the grub config file:
 +
<pre>
 +
cp --backup=numbered -a /boot/grub2/grub.cfg{,.bak} # create backup copy
 +
/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg # update config file
 
</pre>
 
</pre>
- where BOOTDEVICE is usually <code>/dev/sda</code> (If you get an error '/dev/sda does not have any corresponding BIOS drive' from that, then try <tt>/sbin/grub-install --recheck /dev/sda</tt>). For Fedora 16 and later, use <code>/sbin/grub2-install</code> instead of <code>/sbin/grub-install</code>. See [[#15-16|below]] first for important information about upgrading to Fedora 16 from prior releases.
 
  
 
Also, the order of init scripts could have changed from the previous version. A command to reset the order is:
 
Also, the order of init scripts could have changed from the previous version. A command to reset the order is:
Line 172: Line 178:
  
 
<pre>
 
<pre>
yum install fedora-release-rawhide
+
# yum install fedora-release-rawhide yum-utils
yum-config-manager --disable fedora updates updates-testing
+
# yum-config-manager --disable fedora updates updates-testing
yum update yum
+
# yum-config-manager --enable rawhide
yum --releasever=rawhide distro-sync --nogpgcheck
+
# yum update yum
 +
# yum --releasever=rawhide distro-sync --nogpgcheck
 
</pre>
 
</pre>
 +
 +
If you are upgrading from {{FedoraVersion|21}} or later, replace the first command with {{command|yum install fedora-repos-rawhide yum-utils}}.
 +
 +
{{Anchor|19-20}}
 +
 +
=== Fedora 19 -> Fedora 20 ===
 +
 +
Install the new Fedora 20 gpg key and upgrade:
 +
# rpm --import https://fedoraproject.org/static/246110C1.txt
 +
# yum update yum
 +
# yum clean all
 +
# yum --releasever=20 distro-sync
 +
  
 
{{Anchor|18-19}}
 
{{Anchor|18-19}}
=== Fedora 18 -> Fedora 19 (pre release branched) ===
 
  
See the [[Releases/Branched|Branched]] release page for more information on Branched.
+
=== Fedora 18 -> Fedora 19 ===
  
 
{{admon/warning|Incompatible systemd cgroups hierarchy layout|
 
{{admon/warning|Incompatible systemd cgroups hierarchy layout|
Line 189: Line 208:
 
so the upgraded systemd will not understand the previous state of the system correctly. This is known to affect the tracking of user sessions by systemd-logind ([[rhbug:962983|bug #962983]]).
 
so the upgraded systemd will not understand the previous state of the system correctly. This is known to affect the tracking of user sessions by systemd-logind ([[rhbug:962983|bug #962983]]).
  
Expect breakage in active user sessions and make sure to reboot soon after performing the upgrade.}}
+
Expect breakage in active user sessions and make sure to reboot soon after performing the upgrade.  If your screen locks during the upgrade, you may not be able to log back in due to the cgroup changes.  Running the upgrade in a screen(1) session has been reported as a workaround (re-attach from a vt). }}
  
<pre>
+
Install the new Fedora 19 gpg key and upgrade:  
# Install the new Fedora 19 gpg key: {{command|su -c 'rpm --import https://fedoraproject.org/static/FB4B18E6.txt'}}
+
# rpm --import https://fedoraproject.org/static/FB4B18E6.txt
# yum update yum
+
# yum update yum
# yum --releasever=19 distro-sync
+
# yum clean all
</pre>
+
# 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
  
 
{{Anchor|17-18}}
 
{{Anchor|17-18}}

Latest revision as of 23:19, 10 July 2014

This page contains information explaining how to upgrade Fedora using yum.

Contents

[edit] Upgrading Fedora using yum directly

Warning (medium size).png
Upgrading using the yum method described here is not recommended for new users. Use FedUp instead
For upgrades to Fedora 18 and later, the recommended upgrade method is the FedUp tool. This section has instructions on using FedUp to upgrade.

For upgrades to Fedora 17 and earlier, the recommended installation method is with a boot media with the Anaconda installer as detailed in the Installation Guide or via PreUpgrade. PreUpgrade is a slightly different upgrade method where all the packages are downloaded before the system is rebooted into the Anaconda installer.

Although upgrades with yum do work, they are not explicitly tested as part of the release process by the Fedora QA and are not documented in the Fedora installation guide. If you are not prepared to resolve issues on your own if things break, you should probably use the recommended installation methods instead.

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.

[edit] 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.

[edit] Instructions to upgrade using yum

[edit] 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.

[edit] 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.

[edit] 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.)

Idea.png
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.

Idea.png
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.
Idea.png
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.

[edit] 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

[edit] 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:

[edit] Go to a text console

ctrl + alt + F2

(or)

log in as root, and go into runlevel 3

init 3

[edit] Update yum to latest version available in your Fedora version

# yum update yum

[edit] 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.

[edit] Clean the cache

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

# yum clean all

[edit] Upgrade all packages

Warning (medium size).png
Once a live upgrade is started, do not stop the upgrade by rebooting, killing the process, or by any other method until it is complete. Interrupting an upgrade will cause the affected system to be in a mixed state -- partially the old release and partially the new release. In this state, the system will not be reliable and will not operate as expected. You can try running yum distro-sync and package-cleanup --problems to try and fix the problems.
# yum --releasever=<release_number_you_want_to_sync_to> distro-sync
Warning (medium size).png
If you experience any dependency problems, you are at your own and you have to solve them manually. If you are not able to, use preupgrade! Most often it is enough to remove several problematic package(s). Be sure to not remove half of your installation.

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.

[edit] 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"

[edit] 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.

[edit] Version specific notes

[edit] 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.

[edit] 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 20 or later, replace the first command with yum install fedora-repos-rawhide yum-utils.

[edit] Fedora 19 -> Fedora 20

Install the new Fedora 20 gpg key and upgrade:

# rpm --import https://fedoraproject.org/static/246110C1.txt
# yum update yum
# yum clean all
# yum --releasever=20 distro-sync


[edit] Fedora 18 -> Fedora 19

Warning (medium size).png
Incompatible systemd cgroups hierarchy layout
systemd in F19 lays out its cgroups hierarchy differently than in previous Fedora releases.

The new hierarchy has some advantages, but it is incompatible with the old one. No live conversion of the hierarchy is performed during the package upgrade, so the upgraded systemd will not understand the previous state of the system correctly. This is known to affect the tracking of user sessions by systemd-logind (bug #962983).

Expect breakage in active user sessions and make sure to reboot soon after performing the upgrade. If your screen locks during the upgrade, you may not be able to log back in due to the cgroup changes. Running the upgrade in a screen(1) session has been reported as a workaround (re-attach from a vt).

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

[edit] Fedora 17 -> Fedora 18

Note.png
Recommended Upgrade Method (Fedora 17 and newer)
Upgrading with FedUp is the recommended way to upgrade your system!Please check How Can I Upgrade My System with FedUp?


Note: One user has reported problems trying to upgrade an Intel Mac UEFI installation using this method, including the manual bootloader migration. Read more

  1. Install the new Fedora 18 gpg key: su -c 'rpm --import https://fedoraproject.org/static/DE7F38BD.txt'
  2. If you are using SELinux in Enforcing mode, make sure your selinux-policy is up to date: su -c 'yum update selinux-policy'
  3. Upgrade all packages:
    1. su -c 'yum update yum'
    2. su -c 'yum clean all'
    3. su -c 'yum --releasever=18 --disableplugin=presto distro-sync' It is recommended that updates be enabled for this step, for best results.
  4. 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.

[edit] Upgrading from legacy end of life (EOL) Fedoras

Note.png
Yum upgrading from older versions
Upgrading from older versions of Fedora is archived here: Upgrading from EOL Fedora using yum