From Fedora Project Wiki

(clean up the f17-f18 section and drop references to obsolete bugs)
 
(159 intermediate revisions by 47 users not shown)
Line 1: Line 1:
{{autolang|base=yes}}
{{autolang|base=yes}}


This page contains information explaining how to upgrade Fedora using {{command|yum}}.
{{admon/warning| This page is refers to unofficial method of upgrading.  Refer to [[Upgrading]] page on the current official methods to upgrade Fedora.}}


== Upgrading Fedora using yum directly ==
This page contains information explaining how to upgrade Fedora online using {{command|dnf}} (without the DNF system upgrade plugin).


{{admon/warning| Version updates without using anaconda - such as the yum method described here - is unsupported and not recommended! |
== Upgrading Fedora using dnf directly ==


The recommended installation method is with a boot media with the Anaconda installer as detailed in the [http://docs.fedoraproject.org/install-guide/ Installation Guide] or use [[PreUpgrade]]. [[PreUpgrade]] is a slightly different upgrade method where all the packages are downloaded before the system is rebooted into the Anaconda installer.
== Participate ==


Although upgrades with yum do work, they are not explicitly tested as part of the release process by the [[QA|Fedora QA]] and are not documented in the [http://docs.fedoraproject.org/en-US/Fedora/{{FedoraVersion}}/html/Installation_Guide/index.html 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.}}
If you are upgrading using [[Dnf]] and it shows any general dependency issues, please file them in [http://bugzilla.redhat.com Bugzilla]. 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.


When upgrading with yum you don't get any help from 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).
If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]].
 
A live upgrade with yum usually works well with a typical installation and when following the advice below.


== Participate ==
== Upgrading across multiple releases ==


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 need to upgrade across several releases, it is generally recommended to go one release at a time: for example, rather than going directly from {{FedoraVersion|long|previous}} to {{FedoraVersion|long|next}}, first go to {{FedoraVersion|long}} and then from there to {{FedoraVersion|long|next}}. This tends to reduce the number of package dependency issues you may encounter. If you are upgrading from an [[End of life]] release, please also see [[#eol|the end-of-life section]].


If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]].
== Instructions to upgrade using dnf ==
 
== Instructions to upgrade using yum ==


=== 1.  Backup your system ===
=== 1.  Backup your system ===
Line 29: Line 25:
=== 2. Read about common problems ===
=== 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.
Further down in this page there is a list of common problems specific to dnf 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 [http://docs.fedoraproject.org/install-guide/ Installation Guide] and [http://docs.fedoraproject.org/release-notes/ Release Notes] for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of [[Common bugs]].
General advice on upgrading Fedora can be found on the [[Upgrading]] page. You should also read the [http://docs.fedoraproject.org/install-guide/ Installation Guide] and [http://docs.fedoraproject.org/release-notes/ Release Notes] for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of [[Common bugs]].
Line 37: Line 33:
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.)
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.)


{{admon/tip|Find unused config files|Merge and resolve the changes found by the following script: <code>yum install rpmconf; rpmconf -a</code>
{{admon/tip|Find unused config files|Merge and resolve the changes found by the following script: <code>dnf install rpmconf; rpmconf -a</code>
Now find and remove old config which nobody owns: <code>find /etc /var -name '*.rpm?*'</code>}}
Now find and remove old config which nobody owns: <code>rpmconf -c</code>}}


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


{{admon/tip|Find and review "unused" packages| You can find packages not required by other packages with the tool <code>package-cleanup</code> from the <code>yum-utils</code> package: <code>yum install yum-utils; package-cleanup --leaves</code>. 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 <code>yum remove package-name-and-version</code>.<br/>
{{admon/tip|Find and review "unused" packages| You can find packages not required by other packages with the tool <code>package-cleanup</code> from the <code>yum-utils</code> package: <code>dnf install yum-utils; package-cleanup --leaves</code>. 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 <code>dnf remove package-name-and-version</code>.<br/>
Another useful tool for cleaning up unused packages is <code>rpmreaper</code>.  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: <code>yum install rpmreaper</code>.
Another useful tool for cleaning up unused packages is <code>rpmreaper</code>.  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: <code>dnf install rpmreaper</code>.
}}
}}


Line 52: Line 48:
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).
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.
Note that the upgrade is likely to fail if there are outdated dependencies from packages not backed by a dnf 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  
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
 
<pre>$ sudo dnf install fedora-upgrade
$ sudo fedora-upgrade
</pre>
 
When performing upgrade via remote shell, it is good idea to use screen or tmux utility to be able to get back to running transaction in case your connection drops.
 
Alternatively, follow the manual steps:


==== Go to a text console ====
==== Go to a text console ====
Line 64: Line 72:
(or)
(or)


log in as root, and go into runlevel 3
log in as root, and go into multi-user.target


<pre>
<pre>
init 3
systemctl isolate multi-user.target
</pre>
</pre>


==== Update yum to latest version available in your Fedora version ====
==== Fully update your current Fedora install ====


<pre>
<pre>
yum update yum
# dnf upgrade
</pre>
</pre>


==== Install the new fedora gpg key for the version you are updating to ====
{{anchor|packagekey}}
==== Install the package signing key for the release you are upgrading to ====


Keys you may find and verify  at
If you are upgrading across two releases or fewer from Fedora 20 or later, this step should be unnecessary. If you are upgrading from an older Fedora or upgrading across three or more releases, you may need to import the signing key for the target release.


https://fedoraproject.org/keys
If it turns out not to be, you should be able to import keys like so:
<pre>
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64
</pre>
, replacing "23" and "x86_64" with the new Fedora version and your architecture, respectively.


or see a version specific update instructions at the bottom.
You can also find package signing keys for currently-supported releases [https://getfedora.org/keys/ here]. Keys for EOL releases can be found [https://getfedora.org/keys/obsolete.html here]. Click ''Primary'' (or ''Secondary'', if you are using a secondary architecture), and you will see ''Get it from: Fedora Project'', where ''Fedora Project'' is a link. Copy that URL, and run:
<pre>
# rpm --import (url)
</pre>
to install the key. On old releases, {{command|rpm}} may have trouble doing this; if that happens, download the file with {{command|curl -o}} or {{command|wget}} and import the downloaded file.


==== Clean the cache ====
==== Clean the cache ====


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


<pre>
<pre>
yum clean all
# dnf clean all
</pre>
</pre>


==== Upgrade all packages ====
==== Upgrade all packages ====


{{admon/warning|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. }}
{{admon/warning|Never upgrade on battery power|Never run the upgrade operation on battery power! Always connect to the mains, if using a laptop. However, if your system does have a battery, it's a good idea to ensure it's charged and connected in case of a power outage during the upgrade.}}
 
{{admon/warning|Do not interrupt an upgrade for any reason|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 {{command|dnf distro-sync}} and {{command|package-cleanup --problems}} to try and fix the problems.}}
 
Run the upgrade command:


<pre>
<pre>
yum --releasever=<release_number_you_want_to_sync_to> distro-sync
# dnf --releasever=<target_release_number> --setopt=deltarpm=false distro-sync
</pre>
</pre>


{{admon/warning|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.
{{admon/note|Dependency issues|If you experience any dependency problems, you have to solve them manually. These are often caused by packages being retired in the newer release, but not properly obsoleted. Often it is enough to remove several problematic package(s).
}}
 
You may find that a package you care about depends on a package that must be removed for the upgrade to proceed. Usually you will be able to reinstall the important package once the upgrade is complete.
 
If it seems like you must remove a package with many dependencies, especially ones that look important, please be careful. If you are attempting to upgrade across multiple releases, try a smaller jump to see if that avoids the problem.


'''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.
If you are at all unsure in any way, ask for help on a mailing list, forum or IRC before removing packages.}}


=== 5. Make sure Fedora is upgraded ===
=== 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 <pre> yum repolist </pre>  after the upgrade process is over.  <code>yum</code> 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.   
Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well.  Confirm with {{command|dnf repolist}} after the upgrade process is over.  <code>dnf</code> 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
Ensure that all (new) essential packages from the new version are installed with


<pre>
<pre>
yum groupupdate Base
# dnf groupupdate 'Minimal Install'
</pre>
</pre>


Line 118: Line 142:


<pre>
<pre>
yum grouplist
# dnf grouplist
</pre>
</pre>


Line 124: Line 148:


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


Line 135: Line 157:


{{Anchor|bootloader}}
{{Anchor|bootloader}}
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>/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:
<pre>
cd /etc/rc.d/init.d; for f in *; do [ -x $f ] && /sbin/chkconfig $f resetpriorities; done
</pre>
</pre>
- where BOOTDEVICE is often {{code|/dev/sda}}, or {{code|/dev/vda}} for some virtual machine installs. If you have more than one hard disk, make sure you use the correct device!


Again, run <code>package-cleanup --orphans</code> to find packages that haven't been upgraded.
If you get an error (e.g. {{code|/dev/sda does not have any corresponding BIOS drive}}) from that, then try {{command|/usr/sbin/grub2-install --recheck BOOTDEVICE}}).
 
== Version specific notes ==
 
=== From pre-release ===
 
If you are upgrading to a final release from an alpha, beta, preview, or other [[Releases/Rawhide|Rawhide]] release, please see [[Upgrading from pre-release to final]].
 
=== To development version ===


It might also be necessary to update the grub config file:
<pre>
<pre>
yum update yum
cp --backup=numbered -a /boot/grub2/grub.cfg{,.bak} # create backup copy
yum --releasever=rawhide distro-sync --nogpgcheck
/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg # update config file
</pre>
</pre>


{{Anchor|16-17}}
=== 7. Cleanup your system ===
=== Fedora 17 -> Fedora 18 ===
Again, cleanup your system as described in section 2. Also you might want to remove some cache files that are no longer used, for example files from older Fedora releases in the following directories:


{{admon/warning||This references an unreleased version of Fedora.  The steps here may change before release.}}
* <nowiki>/var/cache/dnf</nowiki>
* <nowiki>/var/cache/mock</nowiki>
* <nowiki>/var/lib/mock</nowiki>


# Install the new Fedora 18 gpg key: {{command|su -c 'rpm --import https://fedoraproject.org/static/DE7F38BD.txt'}}
== Release specific notes ==
# Set SELinux to Permissive mode: {{command|su -c 'setenforce Permissive'}}
# Upgrade all packages:
## {{command|su -c 'yum update yum'}}
## {{command|su -c 'yum clean all'}}
## {{command|su -c 'yum --releasever<nowiki>=</nowiki>18 --disableplugin<nowiki>=</nowiki>presto distro-sync'}}
# Rebuild rpm database: {{command|su -c 'rpm --rebuilddb'}}
# Due to [https://fedoraproject.org/wiki/Features/DisplayManagerRework DisplayManagerRework], re-enable your display manager: {{command|su -c 'systemctl enable --force xyzdm.service'}}


If you did not use Permissive mode for 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 or performing actions requiring administrative privileges. This is a result of [[rhbug:844167|bug #844167]]. If you have this problem, you should re-install the affected packages with {{command|su -c 'yum reinstall (packagenames)'}}, and then reboot. Affected packages may include libvirt-daemon and polkit: {{command|su -c 'yum reinstall libvirt-daemon polkit'}}
Note: the release-specific notes for [[End of life]] releases are on the [[Upgrading from EOL Fedora using package manager|EOL packager manager upgrade page]].


=== Fedora 16 -> Fedora 17 ===
=== From pre-release ===
 
{{admon/warning||There is a general warning about upgrading via. yum being unsupported [[Upgrading_Fedora_using_yum#Upgrading_Fedora_using_yum_directly | at the top of this page]]. However Fedora 17 is '''very special'''. You should '''seriously consider''' stopping now and just using anaconda via. DVD or preupgrade, unlike all previous releases it's what the yum/rpm developers recommend. Continue at your own risk. }}
 
First install the new Fedora 17 gpg key
 
rpm --import https://fedoraproject.org/static/1ACA3465.txt
 
Fedora 17 will locate the entire base operating system in /usr. The directories
/bin, /sbin, /lib, /lib64 will only be symlinks:
/bin → /usr/bin
/sbin → /usr/sbin
/lib → /usr/lib
/lib64 → /usr/lib64
 
Some reasoning behind this change is outlined here:
http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge
 
Currently installed systems need some manual steps to convert the current system
to match the layout of Fedora 17. After that, the system can continue to
be updated with YUM as usual.
 
Some RPM packages in Fedora 17 are carrying an RPM dependency guard, which
will make sure, they can only be installed when /bin, /sbin, /lib, /lib64 are
symlinks and not directories like in Fedora 16 and older.
 
The installed system’s base filesystem layout can not be safely altered, while
the system itself is running on top of it. Dracut, the initramfs used to find
and mount the root filesystem, can be instructed to convert the filesystem to
match Fedora 17’s expectations.
 
If your system has a split-off /usr, a separate mount point, the dracut /usr
mount conversion logic might not work. If /usr resides on the net, then you should add "rd.neednet=1" and the network settings like "ip=dhcp" on the kernel command line.
/usr on iSCSI, FCoE, NBD also is supported, as long as “netroot=...” is
specified on the kernel command line for these disks (see man dracut.kernel(7)).
If you have /usr on LVM, MD raid or DM raid, make sure the kernel command line has either all settings like "rd.lvm.lv=..." to ensure the /usr device is accessible in dracut or just remove all restrictions like "rd.lvm...", "rd.md...", "rd.dm...". Either way, you should probably use anaconda to update, if you are experiencing problems with a separate /usr.
 
If you have /var on a separate partition, you will have to manually convert "/var/run" and "/var/lock" to a symbolic link.
 
# mv -f /var/run /var/run.runmove~
# ln -sfn ../run /var/run
# mv -f /var/lock /var/lock.lockmove~
# ln -sfn ../run/lock /var/lock
 
Here are the steps to prepare your system, to convert it, and to be able to
continue updating your installed system with yum:
 
Download and install the most recent dracut packages:
# yum update dracut
 
You should at least have [http://harald.fedorapeople.org/downloads/dracut/dracut-009-15.fc15/dracut-009-15.fc15.noarch.rpm dracut-009-15.fc15] for Fedora 15 or [https://admin.fedoraproject.org/updates/dracut-013-22.fc16 dracut-013-22.fc16] for Fedora 16.
 
Turn off any "hostonly" settings in /etc/dracut.conf*, if you turned on "hostonly".
 
Update the installed initramfs image for your current kernel, and instruct
dracut to include the dracut module to convert your current filesystem:
# dracut --force --add convertfs
 
If your system has a split-off /usr, a separate mount point, and you don't know the kernel command line parameter to add, you can also try (dracut tries to generate them internally), but you have to install at least [https://admin.fedoraproject.org/updates/dracut-018-55.git20120606.fc16 dracut-018].
# dracut -H --force --add convertfs
 
If dracut detects ‘rd.convertfs’ on the kernel command line at bootup, it starts
the filesystem conversion of the root filesystem. If it is already converted, it will just do nothing.
 
{{admon/warning||<code>dracut</code> will by default update the initramfs for the currently running kernel. Make sure that no new kernel has been installed since last boot and that you really will boot into the updated initramfs.}}
 
Change the following kernel commandline parameter directly in the bootloader
menu, which is shown during bootup, or edit the line in <code>/etc/grub*.cfg</code>  to remove ro and rhgb and append <code>rw rd.info rd.convertfs enforcing=0</code>
 
Explanation of the options:
 
- remove “ro” (read only)
- append “rw” (read write) to let dracut mount your root filesystem writeable
- remove “rhgb” (Red Hat graphical boot) to disable the graphical bootsplash
- append “rd.info” to get a more verbose output from dracut
- append “rd.convertfs” to enable the /usr-move conversion script in dracut
- append “enforcing=0” to disable SELinux enforcement
 
During bootup, dracut will now convert your filesystem, and /lib, /lib64, /bin
and /sbin should then all be symbolic links to the corresponding directories in
/usr.
 
After the conversion, the system needs to be immediately updated to Fedora 17. No
packages from Fedora 16 or Fedora 15, or older rawhide packages must be installed anymore.
Make sure to disable any Fedora 15 and Fedora 16 repositories in yum!
 
Any files with conflicting names, which the conversion could not resolve, will
be backed up to files named *.usrmove~ residing in /usr/lib, /usr/lib64,
/usr/bin and /usr/sbin.
 
Verify that dracut really completed the conversion. The log messages, which dracut has generated during bootup, can be retrieved with:
# dmesg | grep dracut
 
After a successful conversion, revert the changes made to the kernel command
line in the bootloader config file /etc/grub*.cfg.
 
Then run,
 
# rm -f /var/lib/rpm/__*
# rpm --rebuilddb
# yum --releasever=17 update rpm
# rm -f /var/lib/rpm/__*
# rpm --rebuilddb
# yum --releasever=17 --disableplugin=presto distro-sync
# fixfiles onboot 
 
After upgrading, all should be set and done.
 
Have fun with your system and say “Good bye” to /bin, /sbin, /lib, /lib64 and
meet them in /usr.
 
{{Anchor|15-16}}
 
=== Fedora 15 -> Fedora 16 ===


First install the new fedora 16 gpg key. You may wish to verify this package against  https://fedoraproject.org/keys and the fedora ssl certificate.
If you are upgrading to a final release from an Alpha, Beta, or release candidate, please see [[Upgrading from pre-release to final]].


<pre>
{{Anchor|Rawhide}}
rpm --import https://fedoraproject.org/static/A82BA4B7.txt
=== To Rawhide ===
</pre>


Next run {{command|chkconfig --list}} and note the enabled services; you will need to re-enable these with {{command|systemctl enable ''xxxxx''.service}} after you reboot, as the {{package|sysvinit}} settings aren't propagated into {{package|systemd}}. See [http://fedoraproject.org/wiki/Common_F16_bugs#Upgrade_from_previous_releases_resets_the_enablement_status_of_services release notes] for more details.
{{admon/warning|Rawhide is a development release for Advanced users|Rawhide is the development branch of Fedora}}


Upgrade all packages with
See the [[Releases/Rawhide|Rawhide]] release page for more information on Rawhide.


<pre>
<pre>
yum update yum
# dnf upgrade
yum clean all
# dnf install dnf-plugins-core fedora-repos-rawhide
yum --releasever=16 --disableplugin=presto distro-sync
# dnf config-manager --set-disabled fedora updates updates-testing
</pre>
# dnf config-manager --set-enabled rawhide
# dnf clean -q dbcache packages metadata
# Go to https://getfedora.org/en/security/ and find the key for the current rawhide version, download and 'rpm --import key.asc'
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync


{{admon/warning|Bootloader change|After the upgrade, you will have the {{package|grub2}} and {{package|grub-efi}} packages installed and the {{package|grub}} package removed. However, grub will still be installed to the MBR and booting should still work. You can follow the instructions below to switch to grub2 if you choose. If installed, the {{package|firstaidkit-plugin-grub}} package may prevent the upgrade; do simply remove that package if that is the case.}}
## Optional: it is generally advised to do a selinux autorelabel and reboot
 
# touch /.autorelabel
If your system uses a BIOS, or you installed Fedora via BIOS emulation mode on an EFI system (not native EFI mode), you can switch to Fedora 16's supported grub2 bootloader with the following instructions. If your system was installed by native EFI boot, do not switch to grub2, as its EFI support is still unreliable. Fedora 16's supported bootloader for native EFI installations is still grub-legacy, so you should simply continue to use the system without making any special changes to the bootloader configuration.
 
To switch to grub2, run the command {{command|su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg'}}, then proceed as described [[#6._Preparing_for_reboot|above]] with reinstalling the bootloader, but call {{command|grub2-install /dev/XXX}} instead of{{command| grub-install /dev/XXX}}.
 
Known you upgrade -specific issues (for common problems, see references above):
* Bug [https://bugzilla.redhat.com/show_bug.cgi?id=743022 743022] - F15->F16 yum update fails with IMSM (BIOS) raid
 
 
{{Anchor|14-15}}
 
=== Fedora 14 -> Fedora 15 ===
 
First install the new fedora 15 gpg key. You may wish to verify this package against  https://fedoraproject.org/keys and the fedora ssl certificate.
 
<pre>
rpm --import https://fedoraproject.org/static/069C8460.txt
</pre>
</pre>


Upgrade all packages with
{{Anchor|30-31}}
{{Anchor|31}}


<pre>
=== Fedora 31 ===
yum update yum
yum clean all
yum --releasever=15 --disableplugin=presto distro-sync
</pre>


* Do not run this from within an X terminal. Testing shows that X might hang while updating bitmap font packages.
Before running  
* There exist .drpms, but they don't match, due to a format change, so better disable the presto plugin by adding the option "--disableplugin=presto" (without quotes) when running yum.
<pre>dnf distro-sync</pre>
* The F15 <code>screen</code> client is not capable of attaching to F14 <code>screen</code> sessions.  Thus, if you want to run the upgrade under <code>screen</code>, you should either upgrade <code>screen</code> itself in a separate operation or make a separate copy of <code>screen</code> to use throughout the process.
you must run  
* mysql 5.5.20 shipped with F15 uses InnoDB as default storage engine. After upgrading, mysqld could refuse to start-up with error ''Unknown/unsupported storage engine: InnoDB'' if argument ''skip-innodb'' is given on command line or configuration file ''/etc/my.cnf''. Workarounds are removing the line (InnoDB will be run as default engine), or adding ''default-storage-engine'' command options specifying some other storage engine.
<pre>dnf module reset libgit2 exa bat</pre>


==== VirtualBox guest upgrades ====
See [https://bugzilla.redhat.com/show_bug.cgi?id=1747408 Bug 1747408]
The steps above work perfectly for upgrading a Fedora 14 guest to Fedora 15, but you also need to remove the Guest Additions. If you forget, F14 -> F15 upgrades will seem to fail after the first reboot. If that happens, log in to the console with CTRL+ALT+F2 and reinstall the guest additions manually:


<pre>
{{Anchor|29-30}}
mount /dev/cdrom /media
{{Anchor|30}}
# if /dev/cdrom does not exist, try:
# mount /dev/sr0 /media
/bin/sh /media/VBoxLinuxAdditions.run
reboot
</pre>


{{Anchor|13-14}}
=== Fedora 30 ===


=== Fedora 13 -> Fedora 14 ===
No special instructions. Follow the above instructions.


First install the new fedora 14 gpg key. You may wish to verify this package against  https://fedoraproject.org/keys and the fedora ssl certificate.
{{Anchor|28-29}}
{{Anchor|29}}
=== Fedora 29 ===


<pre>
No special instructions. Follow the above instructions.
rpm --import https://fedoraproject.org/static/97A1071F.txt
</pre>


Upgrade all packages with
{{Anchor|23-24}}
{{Anchor|24}}


<pre>
yum update yum
yum clean all
yum --releasever=14 distro-sync
</pre>


* If using VirtualBox from the Oracle repository, you must remove the VirtualBox-3.1 package before upgrading.  After the upgrade is finished, install VirtualBox-3.2.
{{anchor|eol}}
=== Upgrading from legacy end of life (EOL) Fedora releases ===


If you are running SELinux you may be locked out of your machine and required to boot to single user mode to fix up your machine. [[rhbug:702865|Redhat bug 702865]] describes a fix as:
Note that Fedora strongly recommends against ever running an end-of-life release on any production system, or any system connected to the public internet, in any circumstances. You should never allow a production Fedora deployment to reach end-of-life in the first place.
<ol>
<li><code>setenforce 0</code>
<li><code>yum remove selinux-policy selinux-policy-targeted</code>
<li><code>rm -rf /etc/selinux/targeted</code>
</ol>


If, after upgrading you want selinux back:
With that in mind, if you do have an end-of-life release installed on a system you cannot just discard or re-deploy, you can attempt to upgrade it, though this is a less-tested and less-supported operation.
<ol>
<li><code>yum install selinux-policy selinux-policy-targeted</code>
<li><code>fixfiles restore</code>
<li><code>reboot</code>
</ol>


=== Upgrading from legacy end of life (EOL) Fedoras ===
For detailed instructions on upgrades from EOL releases, please read [[Upgrading from EOL Fedora using package manager]].
{{admon/note|Yum upgrading from older versions|Upgrading from older versions of Fedora is archived here: [[Upgrading from EOL Fedora using yum]]}}


[[Category:FAQ]]
[[Category:FAQ]]
[[Category:How to]]
[[Category:How to]]
[[Category:Documentation]]
[[Category:Documentation]]

Latest revision as of 07:40, 23 September 2019

Warning.png
This page is refers to unofficial method of upgrading. Refer to Upgrading page on the current official methods to upgrade Fedora.

This page contains information explaining how to upgrade Fedora online using dnf (without the DNF system upgrade plugin).

Upgrading Fedora using dnf directly

Participate

If you are upgrading using Dnf and it shows any general dependency issues, please file them in Bugzilla. 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.

Upgrading across multiple releases

If you need to upgrade across several releases, it is generally recommended to go one release at a time: for example, rather than going directly from Fedora 38 to Fedora 40, first go to Fedora 39 and then from there to Fedora 40. This tends to reduce the number of package dependency issues you may encounter. If you are upgrading from an End of life release, please also see the end-of-life section.

Instructions to upgrade using dnf

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 dnf 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.)

Idea.png
Find unused config files
Merge and resolve the changes found by the following script: dnf install rpmconf; rpmconf -a Now find and remove old config which nobody owns: rpmconf -c

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: dnf 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 dnf 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: dnf 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.

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 dnf 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 dnf install fedora-upgrade 
$ sudo fedora-upgrade

When performing upgrade via remote shell, it is good idea to use screen or tmux utility to be able to get back to running transaction in case your connection drops.

Alternatively, follow the manual steps:

Go to a text console

ctrl + alt + F2

(or)

log in as root, and go into multi-user.target

systemctl isolate multi-user.target

Fully update your current Fedora install

# dnf upgrade

Install the package signing key for the release you are upgrading to

If you are upgrading across two releases or fewer from Fedora 20 or later, this step should be unnecessary. If you are upgrading from an older Fedora or upgrading across three or more releases, you may need to import the signing key for the target release.

If it turns out not to be, you should be able to import keys like so:

 # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64

, replacing "23" and "x86_64" with the new Fedora version and your architecture, respectively.

You can also find package signing keys for currently-supported releases here. Keys for EOL releases can be found here. Click Primary (or Secondary, if you are using a secondary architecture), and you will see Get it from: Fedora Project, where Fedora Project is a link. Copy that URL, and run:

 # rpm --import (url)

to install the key. On old releases, rpm may have trouble doing this; if that happens, download the file with curl -o or wget and import the downloaded file.

Clean the cache

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

# dnf clean all

Upgrade all packages

Warning.png
Never upgrade on battery power
Never run the upgrade operation on battery power! Always connect to the mains, if using a laptop. However, if your system does have a battery, it's a good idea to ensure it's charged and connected in case of a power outage during the upgrade.
Warning.png
Do not interrupt an upgrade for any reason
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 dnf distro-sync and package-cleanup --problems to try and fix the problems.

Run the upgrade command:

# dnf --releasever=<target_release_number> --setopt=deltarpm=false distro-sync
Note.png
Dependency issues
If you experience any dependency problems, you have to solve them manually. These are often caused by packages being retired in the newer release, but not properly obsoleted. Often it is enough to remove several problematic package(s).

You may find that a package you care about depends on a package that must be removed for the upgrade to proceed. Usually you will be able to reinstall the important package once the upgrade is complete.

If it seems like you must remove a package with many dependencies, especially ones that look important, please be careful. If you are attempting to upgrade across multiple releases, try a smaller jump to see if that avoids the problem.

If you are at all unsure in any way, ask for help on a mailing list, forum or IRC before removing packages.

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 dnf repolist after the upgrade process is over. dnf 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

# dnf groupupdate 'Minimal Install'

You might want to update other groups too, see

# dnf grouplist

For example

# dnf 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 often /dev/sda, or /dev/vda for some virtual machine installs. If you have more than one hard disk, make sure you use the correct device!

If you get an error (e.g. /dev/sda does not have any corresponding BIOS drive) from that, then try /usr/sbin/grub2-install --recheck BOOTDEVICE).

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

7. Cleanup your system

Again, cleanup your system as described in section 2. Also you might want to remove some cache files that are no longer used, for example files from older Fedora releases in the following directories:

  • /var/cache/dnf
  • /var/cache/mock
  • /var/lib/mock

Release specific notes

Note: the release-specific notes for End of life releases are on the EOL packager manager upgrade page.

From pre-release

If you are upgrading to a final release from an Alpha, Beta, or release candidate, please see Upgrading from pre-release to final.

To Rawhide

Warning.png
Rawhide is a development release for Advanced users
Rawhide is the development branch of Fedora

See the Rawhide release page for more information on Rawhide.

# dnf upgrade
# dnf install dnf-plugins-core fedora-repos-rawhide
# dnf config-manager --set-disabled fedora updates updates-testing
# dnf config-manager --set-enabled rawhide
# dnf clean -q dbcache packages metadata
# Go to https://getfedora.org/en/security/ and find the key for the current rawhide version, download and 'rpm --import key.asc'
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync

## Optional: it is generally advised to do a selinux autorelabel and reboot
# touch /.autorelabel

Fedora 31

Before running

dnf distro-sync

you must run

dnf module reset libgit2 exa bat

See Bug 1747408

Fedora 30

No special instructions. Follow the above instructions.

Fedora 29

No special instructions. Follow the above instructions.


Upgrading from legacy end of life (EOL) Fedora releases

Note that Fedora strongly recommends against ever running an end-of-life release on any production system, or any system connected to the public internet, in any circumstances. You should never allow a production Fedora deployment to reach end-of-life in the first place.

With that in mind, if you do have an end-of-life release installed on a system you cannot just discard or re-deploy, you can attempt to upgrade it, though this is a less-tested and less-supported operation.

For detailed instructions on upgrades from EOL releases, please read Upgrading from EOL Fedora using package manager.