Upgrading Fedora using package manager

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Remove bogus mention of rawhide in 11->12 instructions. Please don't mention rawhide in a specific section like that.)
(Install the package signing key for the release you are upgrading to: Restore information on where keys live on the system)
 
(299 intermediate revisions by 86 users not shown)
Line 1: Line 1:
This page contains information explaining how to upgrade Fedora using {{command|yum}}.
+
{{autolang|base=yes}}
  
{{admon/caution|Although upgrades with yum have been tested and work, live upgrades are not recommended by the Fedora Project. If you are not prepared to resolve issues on your own if things break, you should probably use the recommended installation methods instead.}}
+
{{admon/warning| This page is refers to unofficial method of upgrading. Refer to [[Upgrading]] page on the current official methods to upgrade Fedora.}}
  
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]. [[PreUpgrade]] is a slightly different upgrade method where the all packages are downloaded before the system is rebooted into the Anaconda installer.
+
This page contains information explaining how to upgrade Fedora online using {{command|dnf}} (without the DNF system upgrade plugin).
  
When upgrading with yum you don't get any help from Anaconda, but if you are lucky you 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) Rebooting after such an upgrade is always very exciting.
+
== Upgrading Fedora using dnf directly ==
 
+
A live upgrade with yum usually works well with a typical installation and when following the advice below.
+
  
 
== Participate ==
 
== Participate ==
  
If you are upgrading using Yum and it shows up any general dependency issues, please file them in http://bugzilla.redhat.com. But please read this page and all references pages and search the mailing list archives before filing bugs. And of course, please help keeping this page updated.
+
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.
 +
 
 +
If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]].
 +
 
 +
== Upgrading across multiple releases ==
  
If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade Live Upgrade Special Interest Group]].
+
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]].
  
== Instructions to upgrade using yum ==
+
== Instructions to upgrade using dnf ==
  
=== 0Back up your system ===
+
=== 1Backup your system ===
  
Back up 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.
+
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.
  
=== 1. Read about common problems ===
+
=== 2. Read about common problems ===
  
Further down in this page there's a list of common problems 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 upgrade to - they contain important information regarding upgrading issues. Finally, check the list of [[Common {{FedoraVersion|short}} 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]].
  
=== 2. Clean Stuff ===
+
=== 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.)
 
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>for a in $(find /etc /var -name '*.rpm?*'); do diff -u $a ${a%.rpm?*}; done</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>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 if 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>.  
+
{{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>dnf install rpmreaper</code>.
 
}}
 
}}
  
 
{{admon/tip|Find and review "lost" packages| You can find orphaned packages (ie packages not in the repositories anymore) with: <code>package-cleanup --orphans</code>. This will also show packages which have been partially uninstalled but where the "%postun" script failed.}}
 
{{admon/tip|Find and review "lost" packages| You can find orphaned packages (ie packages not in the repositories anymore) with: <code>package-cleanup --orphans</code>. This will also show packages which have been partially uninstalled but where the "%postun" script failed.}}
  
Make sure you have the <code>yum-fastestmirror</code> package installed so that yum uses the "best" mirror.
+
=== 4. Do the upgrade ===
  
<pre>
+
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).
yum install yum-fastestmirror
+
</pre>
+
  
Then remove all traces of the version you are leaving from the yum cache in <code>/var/cache/yum</code>.
+
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.
  
<pre>
+
It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then
yum clean all
+
</pre>
+
  
=== 3. Switch repositories ===
+
==== fedora-upgrade ====
  
Update the packages that decide which yum repositories to use.
+
A small script named fedora-upgrade is available which aims to automate the process outlined below. To run it, do the following
  
<pre>
+
<pre>$ sudo dnf install fedora-upgrade
rpm -Uhv ftp://download.fedora.redhat.com/pub/fedora/linux/releases/<ReleaseNumber>/Fedora/<Arch>/os/Packages/fedora-release-*.noarch.rpm
+
$ sudo fedora-upgrade
 
</pre>
 
</pre>
  
(The architecture doesn't matter for this <code>noarch</code> package.)
+
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.
  
'''Note:''' Some users have reported that attempting to download through rpm returns a response 550 and "transfer failed" messages.  If this is the case, you can download the rpms and install locally.  Consider:
+
Alternatively, follow the manual steps:
<pre>
+
wget ftp://download.fedora.redhat.com/pub/fedora/linux/releases/<ReleaseNumber>/Fedora/<Arch>/os/Packages/fedora-release-*.noarch.rpm
+
rpm -Uvh fedora-release-*.noarch.rpm
+
</pre>
+
  
Make sure the new repo files isn't placed as <code>.rpmnew</code> files, perhaps by
+
==== Go to a text console ====
  
 
<pre>
 
<pre>
mv /etc/yum.repos.d/fedora-updates.repo.rpmnew /etc/yum.repos.d/fedora-updates.repo
+
ctrl + alt + F2
mv /etc/yum.repos.d/fedora.repo.rpmnew /etc/yum.repos.d/fedora.repo
+
 
</pre>
 
</pre>
  
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 you most of the time need to install the Rawhide release RPMs from the 3rd party repository as well (or the standard ones, if switching back).
+
(or)
  
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.
+
log in as root, and go into multi-user.target
 
+
=== 4. Do the upgrade ===
+
 
+
If using selinux make sure it is in permissive mode - neither disabled nor enforcing.
+
 
+
It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then go to a text console
+
  
 
<pre>
 
<pre>
ctrl + alt + F2
+
systemctl isolate multi-user.target
 
</pre>
 
</pre>
  
log in as root, and go into runlevel 3
+
==== Fully update your current Fedora install ====
  
 
<pre>
 
<pre>
telinit 3
+
# dnf upgrade
 
</pre>
 
</pre>
  
{{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, doing so 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.  The only way to recover from this is to reinstall if it occurs.}}
+
{{anchor|packagekey}}
 +
==== Install the package signing key for the release you are upgrading to ====
  
{{admon/tip|Update important packages first| You can start try to update the update machinery first with <code>yum update rpm\* yum\*</code>. Another idea is to start with <code>glibc</code>. In both cases dependencies might however expand it to an almost full upgrade anyway. And doing a full upgrade might be more safe. YMMV. (In particular, do not upgrade rpm and yum separately if upgrading to a system with a different version of python e.g. 2.4 to 2.5.)
+
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.
}}
+
 
+
Upgrade all packages with
+
  
 +
If it turns out not to be, you should be able to import keys like so:
 
<pre>
 
<pre>
yum upgrade
+
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64
 
</pre>
 
</pre>
 +
, replacing "23" and "x86_64" with the new Fedora version and your architecture, respectively.
  
<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.
+
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:
 
+
Ensure that all (new) essential packages from the new version is installed with
+
 
+
 
<pre>
 
<pre>
yum groupupdate Base
+
# rpm --import (url)
 
</pre>
 
</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.
  
You might want to update other groups too, see
+
==== Clean the cache ====
  
<pre>
+
Then remove all traces of the version you are leaving from the dnf cache in <code>/var/cache/dnf</code>.
yum grouplist
+
</pre>
+
 
+
For example
+
  
 
<pre>
 
<pre>
yum groupupdate "GNOME Desktop Environment" \
+
# dnf clean all
"Development Tools" "Server Configuration Tools" \
+
"Hardware Support" "Sound and Video" \
+
"Graphical Internet" "Fonts" \
+
"Games and Entertainment" "Printing Software" \
+
"Administration Tools" "Office/Productivity" "System Tools"
+
 
</pre>
 
</pre>
  
=== 5. Preparing for reboot ===
+
==== Upgrade all packages ====
 
+
Before booting you should usually install the bootloader from your new grub by running
+
<pre>
+
/sbin/grub-install BOOTDEVICE
+
</pre>
+
- where BOOTDEVICE usually is <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>.)
+
 
+
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 /sbin/chkconfig $f resetpriorities; done
+
</pre>
+
 
+
Again, run <code>package-cleanup --orphans</code> to find packages that hasn't been upgraded.
+
 
+
== 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]].
+
 
+
{{Anchor|11-12}}
+
=== Fedora 11 -> Fedora 12 ===
+
  
* All Fedora 12 RPM packages use XZ/LZMA compression, which is only supported by the [https://admin.fedoraproject.org/updates/F11/FEDORA-2009-7986 rpm-4.7.1-1 update] (or later) for Fedora 11. Before upgrading from Fedora 11, run <code>yum update rpm</code>.
+
{{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.}}
* It is not possible to update directly from Fedora 10 or earlier with yum. To upgrade from Fedora 10, first update to Fedora 11, and then upgrade from Fedora 11 to Fedora 12. If you are using a release before Fedora 10, use one of the official upgrade methods or backup your data, perform a fresh installation, and restore from backup.
+
* Upgrades from Fedora 11 might currently fail with missing dependencies (for example related to {{package|totem-gstreamer}} or {{package|PolicyKit-kde}}). The dependencies are ok, but Fedora 11 {{package|yum}} has problems resolving them ([[rhbug:519172|bug 519172]]).
+
* If your root filesystem does not mount with 'defaults' options, you will need to add the root filesystem's mount options to grub.conf with the kernel flag <code>rootflags</code> - initramfs does not pick up the options the way initrd used to.  e.g. if you mount your root with the flags <code>data=journal,relatime</code> then you would add to the end of the 'kernel' line in grub.conf: <code>rootflags=data=journal,relatime</code> .
+
  
{{Anchor|10-11}}
+
{{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.}}
  
=== Fedora 10 -> Fedora 11 ===
+
Run the upgrade command:
  
* It is only possible to upgrade to Fedora 11 from an updated Fedora 10. Older systems must be upgraded to Fedora 10 first. The RPM format has been changed for Fedora 11, so the older <code>rpmlib</code> must be updated first.  Otherwise the process will fail with <code>rpmlib(FileDigests)</code> dependency problems. Support for the new format has been backported to Fedora 10 in an update.
 
 
<pre>
 
<pre>
yum update rpm
+
# dnf --releasever=<target_release_number> --setopt=deltarpm=false distro-sync
 
</pre>
 
</pre>
* New <code>initrd</code> built when installing a new kernel while running Fedora 10 might fail. To solve that boot with an old kernel (to get the new userspace) and (re)install the new kernel.
 
* Systems with PAE support (indicated by <code>pae</code> in <code>/proc/cpuinfo</code>) should use <code>kernel-PAE.i686</code>. The new kernel must be changed/installed manually: Set <code>DEFAULTKERNEL=kernel-PAE</code> in <code>/etc/sysconfig/kernel</code> and <code>yum install kernel-PAE</code>. Refer to [http://www.codemonkey.org.uk/?p=142 Dave Jones' blog post] for details.
 
* The yum update step should NOT be run inside a gnome desktop session/gnome-terminal. [[rhbug:494046|494046]] could result in a unusable install when gnome-terminal segfaults during the upgrade. Update should be run in a vty, runlevel 3, or a screen session.
 
* fedora-release-11-1.noarch changes the yum mirrorlist URL so that it uses a  "metalink", but the version of yum currently in F10 doesn't understand this syntax, leading to yum downloads failing with this error message:
 
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 
  Eg. </metalink>/
 
This is [[rhbug:498720|498720]].  Workaround is to manually edit the URL in /etc/yum.repos.d/fedora.repo as described at https://www.redhat.com/archives/fedora-list/2009-June/msg00783.html
 
* Some packages in Fedora 10 are regarded as newer than those supplied by Fedora 11 and its updates repository. These include ntpd, ntpdate ([[rhbug:506040|506040]], [[rhbug:504980|504980]]), unique, unique-devel, eclipse-changelog, eclipse-svnkit and svnkit. You may wish to remove these before performing the upgrade, then reinstall them afterwards. Doing so may require <code>--nodeps</code>.
 
* Some i386 packages in Fedora 10 are replaced with i586, i686 or x86_64 packages in Fedora 11. These include gpm.i386, glibc-2.9-3.i386. You may wish to remove these before performing the upgrade, then reinstall them afterwards. Doing so may require <code>--nodeps</code>.
 
* mplayer-1.0-0.104.20090204svn.fc10 from the RPM Fusion repository has a dependency on libfaad.so.0 that the depsolve doesn't find, but rpm_check_debug does. You may wish to remove mplayer before performing the upgrade, then reinstall them afterwards. Doing so may require <code>--nodeps</code>.
 
  
{{Anchor|9-10}}
+
{{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).
  
=== Fedora 9 -> Fedora 10 ===
+
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.
  
* Check the [http://docs.fedoraproject.org/install-guide/f10/en_US/ Fedora 10 Installation Guide] and [http://docs.fedoraproject.org/release-notes/f10/en_US/ Fedora 10 Release Notes]
+
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.
* <code>fedora-release</code> packages can be found at <code>rpm -Uvh ftp://download.fedora.redhat.com/pub/fedora/linux/releases/10/Fedora/i386/os/Packages/fedora-release-*.noarch.rpm</code>
+
* GDM starts on tty1 by default, not tty7.
+
* anaconda by default now refers to encrypted devices by UUID, not by device name, to better handle device name changes. An encrypted device using partition <code>/dev/sda1</code> with UUID <code>12345678-1234-1234-1234-123456789012</code> would now be called <code>/dev/mapper/luks-12345678-1234-1234-1234-123456789012</code> instead of <code>/dev/mapper/luks-sda1</code>. You may wish to make the same changes on your system on upgrade; if you do, make sure to run <code>mkinitrd</code> afterwards.
+
* If you use non-root encrypted devices, you will need to re-run <code>mkinitrd</code> for any older kernels that you want to still boot on the system.
+
* It's been reported that there are problems with Pidgin i.e.:
+
** <code>pidgin-2.5.2-2.fc9.i386 from installed has depsolving problems - Error: Missing Dependency: libedataserver-1.2.so.9 is needed by package pidgin-2.5.2-2.fc9.i386 (installed)</code>
+
** the fix was to remove Pidgin
+
  
{{Anchor|8-9}}
+
If you are at all unsure in any way, ask for help on a mailing list, forum or IRC before removing packages.}}
=== Fedora 8 -> Fedora 9 ===
+
  
* Check the [http://docs.fedoraproject.org/release-notes/f9/en_US/sn-Installer.html#Upgrade-Related-Issues Installer section in Release Notes])
+
=== 5. Make sure Fedora is upgraded ===
* After "the incident" you should use updated fedora-release packages from <code>rpm -Uvh ftp://download.fedora.redhat.com/pub/fedora/linux/updates/9/i386.newkey/fedora-release-*.noarch.rpm</code>
+
* If you are running as a <code>xen</code> Host (Dom0) you should not upgrade to Fedora 9. [http://www.redhat.com/archives/fedora-xen/2008-March/msg00013.html]
+
* Upgrading the thunderbird package will [[rhbug:446351|fail]] . The current workaround is <code>yum remove thunderbird; yum install thunderbird></code>.
+
* If you are upgrading to Fedora 9 and use <code>emacs</code>, you must upgrade to the latest version of <code>emacs</code> for your prior release to ensure a clean upgrade. Fedora 8 users must have <code>emacs-22.1-10.fc8</code> or later, while Fedora 7 users must have <code>emacs-22.1-7.fc7</code>.  Bug report [[rhbug:239745|here]].
+
* Due to the switch from sysvinit to [http://fedoraproject.org/wiki/Features/Upstart Upstart] , it is recommended that users who do an upgrade on a live filesystem to Fedora 9 reboot soon afterwards. If you do not reboot, you may want to take careful note of any '/etc/inittab.rpmsave' or '/etc/inittab.rpmnew' files. When rebooting after an upgrade then be aware that sysvinit that was used to start the system can't be used to shut it down.
+
* You may find that after upgrading, you can no longer log in to GNOME. If this is the case, use ctrl-alt-F1 to access command prompt, then check the tail of .xsession-errors. If you see a comment like "(named color or font does not exist)", then you may be able to fix this using http://matthew.peach.net.nz/2008/05/18/how-to-fix-badname-named-color-or-font-does-not-exist-error/.
+
  
{{Anchor|7-8}}
+
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. 
=== Fedora 7 -> Fedora 8 ===
+
  
* New pulseaudio and flash support packages must be installed manually:
+
Ensure that all (new) essential packages from the new version are installed with
  
 
<pre>
 
<pre>
yum groupinstall sound-and-video gnome-desktop (if you are using Gnome)
+
# dnf groupupdate 'Minimal Install'
yum groupinstall sound-and-video kde-desktop (if you are using KDE)
+
yum install libflashsupport paman padevchooser
+
 
</pre>
 
</pre>
  
* The Fedora 7 avahi packagage fails to uninstall; remove it manually with
+
You might want to update other groups too, see
  
 
<pre>
 
<pre>
rpm -e --noscripts avahi-0.6.17-1.fc7
+
# dnf grouplist
 
</pre>
 
</pre>
  
* On 64 bit machines (x86_64) you may have to remove some 32 bit libraries. For example dbus:
+
For example
  
 
<pre>
 
<pre>
yum erase dbus.i386
+
# dnf groupupdate "GNOME Desktop" \
 +
    "Development Tools" "Sound and Video" \
 +
    "Games and Entertainment" "Administration Tools" \
 +
    "Office/Productivity" "System Tools"
 
</pre>
 
</pre>
  
* You may find it easier to use the yum shell to stack these commands in a single transaction:
+
=== 6. Preparing for reboot ===
  
 +
{{Anchor|bootloader}}
 +
Before booting you should usually install the bootloader from your new grub by running
 
<pre>
 
<pre>
yum shell
+
/usr/sbin/grub2-install BOOTDEVICE
> erase dbus.i386
+
> update
+
> run
+
 
</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!
  
* A lot of KDE packages are no longer multilib in F8. If you are on x86_64, you will need to erase the i386 versions of these packages by hand, like so:
+
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}}).
  
 +
It might also be necessary to update the grub config file:
 
<pre>
 
<pre>
yum erase kde{accessibility{,-devel},base,edu,graphics,multimedia{,-extras},network,sdk,utils{,-devel},webdev}.i386
+
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>
  
* Various other packages including Beryl are no longer in F8 and not obsoleted:
+
=== 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:
  
<pre>
+
* <nowiki>/var/cache/dnf</nowiki>
yum erase beryl\*
+
* <nowiki>/var/cache/mock</nowiki>
</pre>
+
* <nowiki>/var/lib/mock</nowiki>
  
{{Anchor|6-7}}
+
== Release specific notes ==
=== Fedora Core 6 -> Fedora 7 ===
+
  
* Fedora 7 replaces the old IDE subsystem with libata. Drive device names which previously started /dev/hd.. will become /dev/sd.. after the upgrade. /dev/hda1 will usually become /dev/sda1, although there may not be a direct relationship between the old and new device names (for example hdd does not necessarily become sdd). Before you reboot be sure to change all references to /dev/hd.. in your config, especially /etc/fstab - where it however may be simpler to refer to filesystems by label (check out the programs blkid, tune2fs, and mlabel). LVM Volume names are not affected. In /boot/grub/device.map change /dev/hd.. to /dev/sd.. before running grub-install - and don't change (hd0). Changing /boot/grub/grub.conf may also be required.
+
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]].
  
* The libata layer represents all hard disks as SCSI disks, which are limited to 15 partitions in the kernel. IDE hard disks with more than 15 partitions are not supported in Fedora 7.
+
=== From pre-release ===
  
* On a system which has been upgraded from releases prior to FC6 you may need to remove up2date and rhnlib <code>rpm -e rhnlib up2date</code>
+
If you are upgrading to a final release from an Alpha, Beta, or release candidate, please see [[Upgrading from pre-release to final]].
  
* If you see the message <code>package gpm-1.20.1-84.fc6 (which is newer than gpm-1.20.1-83.fc7) is already installed</code> when performing a <code>yum update</code> uninstall and reinstall the gpm package.
+
{{Anchor|Rawhide}}
 +
=== To Rawhide ===
  
* If you had installed Suns jre it might be removed during upgrade. Be aware that <code>jre-6u1</code>/<code>jre-1.6.0_01-fcs</code> requires <code>compat-libstdc++-33</code>.
+
{{admon/warning|Rawhide is unstable|Rawhide is the development branch of Fedora. It is meant to be used by developers and testers to provide feedback to the Fedora Project.}}
  
* If you get <code>Error: Missing Dependency: python(abi) = 2.4 is needed by package libxml2-python</code> and/or <code>Error: Missing Dependency: python(abi) = 2.4 is needed by package rpm-python</code> during your <code>yum upgrade</code> ensure you have done a <code>yum clean all</code> and check that both the <code>base</code> and <code>updates</code> repositories are available from your mirror. You will need the <code>updates</code> repo for the upgrade to succeed.
+
See the [[Releases/Rawhide|Rawhide]] release page for more information on Rawhide.  
  
* Since Fedora Core 6 uses python 2.4 and Fedora 7 uses python 2.5, do not try and run <code>yum upgrade yum\* rpm\*</code> before upgrading everything else - this succeeds but leaves yum in an unusable state.
 
 
=== Fedora Core 5 -> Fedora Core 6 ===
 
 
* After upgrading, you cannot use the DVD ISO loopback mounted as a repository directly (e.g. no <code>baseurl=file:///mnt/fc6/</code>) because the repodata files contain URLs of type <code>media://</code>  which yum can't handle.  You can use the loopback-mounted DVD for the initial upgrade from FC5 -> FC6, just not thereafter.  After removing the <code>baseurl=file:///</code> option from your <code>fedora-core.repo</code> file, remember to <code>yum clean all</code>.
 
 
=== Fedora Core 4 -> Fedora Core 5 ===
 
 
* Before upgrading update your kernel first.
 
 
* Make sure you have the latest kernel ABOVE 2.6.14 and uninstall all kernel versions before it, otherwise initscripts and a few other packages will conflict and prevent the ugprade. Use something like the command below
 
 
* Install <code>fedora-release</code> in the Fedora Core 5 version. Check our [http://fedora.redhat.com/Download/mirrors.html mirror sites]  for a faster download.
 
 
* Update your system
 
 
* After upgrading, selinux permissions may be incorrect, causing interesting failures such as metacity not starting. As suggested below, to fix this, run <code>touch /.autorelabel</code> and reboot
 
 
=== Fedora Core 3 -> Fedora Core 4 ===
 
 
* make sure you're on the latest version of yum for FC3:
 
<code> yum update yum </code>
 
* Download fedora-release for FC4:
 
* wget http://yourmirrorhere/pub/fedora/linux/core/4/$yourarch/os/Fedora/RPMS/fedora-release-4-2.noarch.rpm
 
* <code>rpm -Uvh /path/to/fedora-release-4-2.noarch.rpm</code>
 
* yum update ( This will start the upgradation process to FC4)
 
* Once you have updated, run: <code>yum groupinstall "GNOME Desktop Environment"</code> (change GNOME to KDE if appropriate). That'll get you some new packages that were added in FC4 like Evince and NetworkManager.
 
* Some new groups were added - <code> yum grouplist </code> - check out Eclipse and Java Development in particular.
 
 
Problems:
 
 
* Postgres database in FC4 has a newer incompatible format from the previous versions. Manual dump and restoration is required if you using this database. Look at the postgres documentation for more details on this.
 
 
* kernel requires kernel-utils (or vice-versa) run:
 
 
<pre>
 
<pre>
yum update kernel
+
# dnf upgrade
reboot
+
# dnf install dnf-plugins-core fedora-repos-rawhide
yum remove kernel-2.6.11\*FC3\*
+
# dnf config-manager --set-disabled fedora updates updates-testing
yum upgrade
+
# dnf config-manager --set-enabled rawhide
reboot
+
# dnf clean -q dbcache packages metadata
</pre>
+
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync --nogpgcheck
  
* Takes forever and a day and hangs at:
+
## Optional: it is generally advised to do a selinux autorelabel and reboot
<code> Reading repository metadata in from local files </code>
+
# touch /.autorelabel
This means you have too much crap in your rpmdb and it's taking a while to go through it. Check out how many kernels you have installed: rpm -q kernel kernel-smp and remove the old ones you may also try running: rpm --rebuilddb and see if it helps any. I've found that removing old kernels and rebuilding the rpmdb helped this problem.
+
 
+
* x86_64 upgrade requires removal of certain i386 packages before update
+
<pre>
+
yum remove perl.i386
+
TODO: Add list of bonobo i386 packages to remove here
+
 
</pre>
 
</pre>
* Error: Missing Dependency: libpython2.3.so.1.0 is needed by package koffice
 
koffice was removed from Fedora Core and not moved to extras - so there's no way to complete an upgrade to FC4
 
without removing it. run:
 
<pre>
 
yum remove koffice
 
</pre>
 
then your update should complete.
 
  
* x86_64 systems seems to hang during "Running Transaction Test"
+
{{Anchor|24-25}}
 +
{{Anchor|25}}
 +
=== Fedora 25 ===
  
Seems related to bug [[rhbug:155730|155730]]  -- Maybe a update to the "rpm-4.3.3-3.0.fc3" (currently in updates-testing) might solve this. Ugly workaround (to be done as root):
+
No special instructions. Follow the above instructions.
<pre>
+
: > /var/log/lastlog
+
</pre>
+
  
* GPG check fails with this message :
+
{{Anchor|23-24}}
<pre>
+
{{Anchor|24}}
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID db42a60e
+
=== Fedora 24 ===
public key not available for <some_package>
+
Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
 
+
The GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora (0x4F2A6FD2)
+
is already installed but is not the correct key for this package.
+
Check that this is the correct key for the "Fedora Core 4 - i386 - Base" repository.
+
</pre>
+
Edit /etc/yum.repos.d/fedora.repo and replace the line
+
<pre>
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
</pre>
+
with:
+
<pre>
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
</pre>
+
 
+
* SELinux gets messed up. I had to redownload the selinux-policy-targeted RPM from my mirror, do a forced uninstall of the old package, clean out the .rpmnew and .rpmsave files then install the new policy. Then I had to run "/sbin/fixfiles relabel" and wait. If I didn't do that, I found I couldn't log in.
+
* If SELinux does give you problems, it can be disabled on bootup by pressing "a" on the grub bootup menu, then adding "enforcing=off" to the arguments list.
+
 
+
* RPM complains about missing diskspace, but there is a lot free. If you are really sure your diskspace is enough, set
+
<pre>
+
diskspacecheck=0
+
</code> in <code>/etc/yum.conf</code>.
+
The RPM transaction will need a lot of diskspace temporarily (much more than one might think), so be careful.
+
Don't forget to remove that later after the upgrade.
+
 
+
* Yum complains about files conflicting in the GCC package.  This system was upgraded from Fedora Core 1.  Remove the gcc32 package:
+
<pre>
+
sudo rpm -e gcc32
+
</pre>
+
 
+
* Some of your modules don't load after the upgrade.  When you investigate modprobe doesn't work as expected.  Run depmod:
+
<pre>
+
sudo depmod -ae -F /boot/System.map-[your <code>uname -a</code> kernel version here]
+
</pre>
+
  
* Yum has been reported to be hanging after upgrading. Updating the pysqlite package might fix it.
+
No special instructions. Follow the above instructions.
  
=== Fedora Core 2 -> Fedora Core 3 ===
+
{{anchor|eol}}
 +
=== Upgrading from legacy end of life (EOL) Fedora releases ===
  
Go here for most of this info:
+
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.
http://linux.duke.edu/~skvidal/misc/fc2-fc3-update-with-yum.txt
+
  
=== Fedora Core 1 -> Fedora Core 2 ===
+
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.
  
Just Upgrade using anaconda - save yourself a world of pain. But if you really want to try, there's these hints by Seth Vidal: http://linux.duke.edu/~skvidal/misc/fc1-fc2-yum-hints.txt
+
For detailed instructions on upgrades from EOL releases, please read [[Upgrading from EOL Fedora using package manager]].
  
[[Category:FAQ]][[Category:How to]][[Category:Documentation]]
+
[[Category:FAQ]]
 +
[[Category:How to]]
 +
[[Category:Documentation]]

Latest revision as of 21:03, 20 December 2016

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

Contents

[edit] Upgrading Fedora using dnf directly

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

[edit] 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 26 to Fedora 28, first go to Fedora 27 and then from there to Fedora 28. 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.

[edit] Instructions to upgrade using dnf

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

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

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

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

[edit] Go to a text console

ctrl + alt + F2

(or)

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

systemctl isolate multi-user.target

[edit] Fully update your current Fedora install

# dnf upgrade

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

[edit] Clean the cache

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

# dnf clean all

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

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

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

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

[edit] Release specific notes

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

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

[edit] To Rawhide

Warning.png
Rawhide is unstable
Rawhide is the development branch of Fedora. It is meant to be used by developers and testers to provide feedback to the Fedora Project.

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
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync --nogpgcheck

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

[edit] Fedora 25

No special instructions. Follow the above instructions.

[edit] Fedora 24

No special instructions. Follow the above instructions.

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