From Fedora Project Wiki

(→‎Fedora Core 6 -> Fedora 7: I just discovered and resolved this issue while upgrading a server of mine remotely.)
mNo edit summary
(309 intermediate revisions by 96 users not shown)
Line 1: Line 1:
= Upgrading Fedora Using Yum =
{{autolang|base=yes}}


== Warning ==
{{admon/warning|Although upgrades with yum do work, they are not explicitly tested as part of the release process by [[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 [[Upgrading|recommended installation methods]] instead.}}


{{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.}}
This page contains information explaining how to upgrade Fedora using {{command|yum}} or {{command|dnf}}: in general the instructions apply equally to both tools, you may substitute one for the other at any point. {{command|dnf}} is the default tool for Fedora 22 and later, {{command|yum}} for Fedora 21 and earlier.


== Caution ==
== Upgrading Fedora using yum directly ==


{{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 recommend installation methods instead. With a typical installation, this method usually works well, but it can break third-party packages not available in the Fedora repositories. Please search the mailing list archives first if you run into problems.}}
When upgrading with yum you don't get any help from [[Upgrading|the recommended upgrade mechanisms]], but with a typical system 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).


The recommended installation method is detailed in the Installation Guide:
A live upgrade with yum usually works well with a typical installation and when following the advice below.


http://docs.fedoraproject.org/install-guide/
== Participate ==


Preupgrade is a new upgrade method that does in-place upgrade. Refer to
If you are upgrading using Yum 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.


https://fedoraproject.org/wiki/PreUpgrade
If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]].


The release notes also have some useful information:
== Instructions to upgrade using yum ==
 
http://docs.fedoraproject.org/release-notes/f8/en_US/sn-Installer.html#Upgrade-Related-Issues
 
Other details on upgrading Fedora is available from the wiki page DistributionUpgrades.
 
== Participate ==


If you want to help make live upgrades work smoothly, join the Live Upgrade Special Interest Group at http://fedoraproject.org/wiki/SIGs/LiveUpgrade.
=== 1. Backup your system ===


== Feedback ==
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.


If you are upgrading using Yum and it shows up any general dependency issues, please file them in http://bugzilla.redhat.com.
=== 2. Read about common problems ===


== Instructions to upgrade using yum ==
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.


=== 1. Read about common problems ===
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]].


Further down in this page there's a list of common problems. Some of them require attention before the upgrade.
=== 3. Clean Stuff ===


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


{{admon/tip|Clean up|Review and remove all .rpmsave and .rpmnew files before and after upgrading. 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>yum install rpmconf; rpmconf -a</code>
Now find and remove old config which nobody owns: <code>find /etc /var -name '*?.rpm?*'</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.


If you have packages from 3rd party repos installed then make sure that these repos are enabled and ready for the new version. The upgrade might fail if there are outdated dependencies from packages not backed by a yum repo or backed by a repo which isn't ready for the new version.
{{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/>
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>.
}}


{{admon/tip|Find and review "lost" packages| You can find orphaned packages (ie packages not in the repositories anymore) with the tool <code>package-cleanup</code> from the <code>yum-utils</code> package: <code>yum install yum-utils; package-cleanup --orphans</code>. Old packages with a failing "%postun" script will remain partly installed. Remove them with rpm -e package-name-and-version. It's often helpful to run this command after the update, too.  
{{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 yum 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 yum 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>


For Fedora 9, as an example,
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.


<pre>
Alternatively, follow the manual steps:
rpm -Uvh ftp://download.fedora.redhat.com/pub/fedora/linux/updates/9/i386.newkey/fedora-release-*.noarch.rpm
</pre>


(The architecture doesn't matter for this <code>noarch</code> package.)
==== Go to a text console ====
 
Make sure the new repo files isn't placed as <code>.rpmnew</code> files, perhaps by


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


Also make sure that all the 3rd party repos you normally use point to the repository for the new Fedora release.
(or)


=== 4. Do the upgrade ===
log in as root, and go into multi-user.target
 
It is a good idea to do this outside the graphical environment. Log out of your graphical desktop and then go to a text console


<pre>
<pre>
ctrl + alt + F1
systemctl isolate multi-user.target
</pre>
</pre>


log in as root, and go into runlevel 3
==== Update yum to latest version available in your Fedora version ====


<pre>
<pre>
telinit 3
# yum update yum
</pre>
</pre>


{{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.
==== Install the new fedora gpg key for the version you are updating to ====
}}


Upgrade all packages with
Keys you may find and verify  at


<pre>
https://fedoraproject.org/keys
yum upgrade
</pre>


<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.
or see a version specific update instructions at the bottom.


Ensure that all (new) essential packages from the new version is installed with
==== Clean the cache ====


<pre>
Then remove all traces of the version you are leaving from the yum cache in <code>/var/cache/yum</code>.
yum groupupdate Base
</pre>
 
You might want to update other groups too, see


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


For example
==== Upgrade all packages ====


<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. Interrupting an upgrade will cause the affected system to be in a mixed state -- partially the old release and partially the new release.  In this state, the system will not be reliable and will not operate as expected.  You can try running yum distro-sync and package-cleanup --problems to try and fix the problems. }}
yum groupupdate "GNOME Desktop Environment" \
"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>
 
Before booting you should usually install the bootloader from your new grub by running


<pre>
<pre>
/sbin/grub-install BOOTDEVICE
# yum --releasever=<release_number_you_want_to_sync_to> distro-sync
</pre>
</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:
{{admon/warning|If you experience any dependency problems, you have to solve them manually. Most often it is enough to remove several problematic package(s). Be very careful when doing so however.
}}


<pre>
'''Note:''' While it is recommended to upgrade to intermediate releases if upgrading from an older release (for example upgrading from Fedora 19 to 20, then 20 to 21), 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.
cd /etc/rc.d/init.d; for f in *; do /sbin/chkconfig $f resetpriorities; done
</pre>
 
== Version specific notes ==


=== Fedora 9 -> Fedora 10 Beta ===
=== 5. Make sure Fedora is upgraded ===


* You will need to remove your old xorg.conf, otherwise X hangs once you log into the desktop. It's probably a reasonable idea to back it up before you delete it, so:
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.
  mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
* restart X after doing this.


=== Fedora 8 -> Fedora 9 ===
Ensure that all (new) essential packages from the new version are installed with
 
* 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 [https://bugzilla.redhat.com/show_bug.cgi?id=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 [https://bugzilla.redhat.com/show_bug.cgi?id=239745 here] .
* Due to the switch from sysvinit to [http://fedoraproject.org/wiki/Features/Upstart Upstart] , it is recommended that users who do a 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.
 
 
=== Fedora 7 -> Fedora 8 ===
 
* New pulseaudio and flash support packages must be installed manually:


<pre>
<pre>
yum groupinstall sound-and-video gnome-desktop (if you are using Gnome)
# yum 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
# yum 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
# yum 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 usually <code>/dev/sda</code> (If you get an error '/dev/sda does not have any corresponding BIOS drive' from that, then try <tt>/usr/sbin/grub2-install --recheck /dev/sda</tt>).


* 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:
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:
Also, the order of init scripts could have changed from the previous version. A command to reset the order is:
 
<pre>
<pre>
yum erase beryl\*
cd /etc/rc.d/init.d; for f in *; do [ -x $f ] && /sbin/chkconfig $f resetpriorities; done
</pre>
</pre>


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


=== Fedora Core 6 -> Fedora 7 ===
* <nowiki>/var/cache/yum</nowiki>
* <nowiki>/var/cache/dnf</nowiki>
* <nowiki>/var/cache/mock</nowiki>
* <nowiki>/var/lib/mock</nowiki>


* 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.
== Version specific notes ==


* 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, preview, or other [[Releases/Rawhide|Rawhide]] release, 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 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.  


=== Fedora Core 5 -> Fedora Core 6 ===
<pre>
# 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 plugins metadata
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync --nogpgcheck


* 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>.
## Optional: it is generally advised to do a selinux autorelabel and reboot
 
# touch /.autorelabel
=== Fedora Core 4 -> Fedora Core 5 ===
</pre>
 
* 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


=== Fedora Core 3 -> Fedora Core 4 ===


* make sure you're on the latest version of yum for FC3:
{{Anchor|20-21}}
<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:
=== Fedora 22 -> Fedora 23 ===


* 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.
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-$(uname -i)
# dnf upgrade
# dnf clean all
# dnf --releasever=23 --setopt=deltarpm=false distro-sync --nogpgcheck


* kernel requires kernel-utils (or vice-versa) run:
=== Fedora 21 -> Fedora 22 ===
<pre>
yum update kernel
reboot
yum remove kernel-2.6.11\*FC3\*
yum upgrade
reboot
</pre>


* Takes forever and a day and hangs at:
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$(uname -i)
<code> Reading repository metadata in from local files </code>
# yum update yum
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.
# yum clean all
# yum --releasever=22 distro-sync


* x86_64 upgrade requires removal of certain i386 packages before update
=== Fedora 20 -> Fedora 21 ===
<pre>
yum remove perl.i386
TODO: Add list of bonobo i386 packages to remove here
</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"
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-$(uname -i)
# yum update yum
# yum clean all
# yum --releasever=21 distro-sync


Seems related to [https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155730 Bug 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):
Fedora 21 split into different products. Execute '''one''' of those commands:
<pre>
: > /var/log/lastlog
</pre>


* GPG check fails with this message :
# yum install system-release-workstation
<pre>
# yum install system-release-cloud
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID db42a60e
# yum install system-release-server
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)
or this one if you want to have non-productized Fedora
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.
# yum install system-release-nonproduct
* 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
If you change your mind, you can easily switch between products.  
<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:
  # yum swap system-release-cloud system-release-workstation
<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:
Swapping to workstation sometimes may require you to use {{command|yum shell}} as it may require multiple packages to be swapped.
<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.
Many people report (e.g. bugs 1035326, 1044184, 1002331) that after upgrade some files have incorrect SELinux context. It is recommend to run:


=== Fedora Core 2 -> Fedora Core 3 ===
  # restorecon -R /


Go here for most of this info:
Appear to be enable to shutdown/reboot gracefully afterwards:
http://linux.duke.edu/~skvidal/misc/fc2-fc3-update-with-yum.txt


=== Fedora Core 1 -> Fedora Core 2 ===
# shutdown -h now
Failed to start poweroff.target: Connection timed out
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.


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
=== Upgrading from legacy end of life (EOL) Fedoras ===
{{admon/note|Yum upgrading from older versions|Upgrading from older versions of Fedora is archived here: [[Upgrading from EOL Fedora using yum]]}}


----
[[Category:FAQ]]
[[CategoryFAQ|  CategoryFAQ]]
[[Category:How to]]
[[Category:Documentation]]

Revision as of 02:06, 3 September 2015

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

This page contains information explaining how to upgrade Fedora using yum or dnf: in general the instructions apply equally to both tools, you may substitute one for the other at any point. dnf is the default tool for Fedora 22 and later, yum for Fedora 21 and earlier.

Upgrading Fedora using yum directly

When upgrading with yum you don't get any help from the recommended upgrade mechanisms, but with a typical system 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).

A live upgrade with yum usually works well with a typical installation and when following the advice below.

Participate

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

Instructions to upgrade using yum

1. Backup your system

Backup any personal data to an external hard drive or to another machine. If there is some unrecoverable error that requires a fresh install, you don't want to lose any data.

2. Read about common problems

Further down in this page there is a list of common problems specific to yum upgrades for specific versions. Some of them require attention before the upgrade.

General advice on upgrading Fedora can be found on the Upgrading page. You should also read the Installation Guide and Release Notes for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of Common bugs.

3. Clean Stuff

Review and remove all .rpmsave and .rpmnew files before and after upgrading. (And if you have selinux enabled then remember to check security context if you move config files around.)

Idea.png
Find unused config files
Merge and resolve the changes found by the following script: yum install rpmconf; rpmconf -a Now find and remove old config which nobody owns: find /etc /var -name '*?.rpm?*'

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

Idea.png
Find and review "unused" packages
You can find packages not required by other packages with the tool package-cleanup from the yum-utils package: yum install yum-utils; package-cleanup --leaves. These packages could be candidates for removal, but check to see whether you use them directly or if they are used by applications not backed by rpm packages. Remove them with yum remove package-name-and-version.
Another useful tool for cleaning up unused packages is rpmreaper. It's an ncurses application that lets you view rpm dependency graph and mark packages for deletion. Marking one package can make other packages leaf, which you can see immediately, so you don't have to run the tool several times to get rid of whole sub-tree of unused packages. Install with: yum install rpmreaper.
Idea.png
Find and review "lost" packages
You can find orphaned packages (ie packages not in the repositories anymore) with: package-cleanup --orphans. This will also show packages which have been partially uninstalled but where the "%postun" script failed.

4. Do the upgrade

If you have 3rd party repositories configured, you may need to adjust them for the new Fedora version. If you switch from one Fedora release to another there is often nothing that needs to be done. If you switch to Rawhide from a standard Fedora release (or vice versa) then most of the time you will need to install the Rawhide release RPMs from the 3rd party repository as well (or the standard ones, if switching back).

Note that the upgrade is likely to fail if there are outdated dependencies from packages not backed by a yum repository or backed by a repository which isn't ready for the new version.

It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then

fedora-upgrade

A small script named fedora-upgrade is available which aims to automate the process outlined below. To run it, do the following

$ sudo yum install fedora-upgrade 
$ sudo fedora-upgrade

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

Update yum to latest version available in your Fedora version

# yum update yum

Install the new fedora gpg key for the version you are updating to

Keys you may find and verify at

https://fedoraproject.org/keys

or see a version specific update instructions at the bottom.

Clean the cache

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

# yum clean all

Upgrade all packages

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

Note: While it is recommended to upgrade to intermediate releases if upgrading from an older release (for example upgrading from Fedora 19 to 20, then 20 to 21), depending on what version you are upgrading from, this step may fail with an error about GPG keys being in the wrong format. To overcome this, you can add the "--nogpgcheck" switch to the above yum distro-sync command.

5. Make sure Fedora is upgraded

Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well. Confirm with

 yum repolist 

after the upgrade process is over. yum might complain about conflicts or requirements. That is probably because you have used non-standard repositories or installed non-standard packages manually. Try to guess which packages cause the problem (or at least is a part of the dependency chain) - uninstall them and try again. Remember to install the packages again if they are essential.

Ensure that all (new) essential packages from the new version are installed with

# yum groupupdate 'Minimal Install'

You might want to update other groups too, see

# yum grouplist

For example

# yum groupupdate "GNOME Desktop" \
    "Development Tools" "Sound and Video" \
    "Games and Entertainment" "Administration Tools" \
    "Office/Productivity" "System Tools"

6. Preparing for reboot

Before booting you should usually install the bootloader from your new grub by running

/usr/sbin/grub2-install BOOTDEVICE

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

It might also be necessary to update the grub config file:

cp --backup=numbered -a /boot/grub2/grub.cfg{,.bak} # create backup copy
/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg # update config file

Also, the order of init scripts could have changed from the previous version. A command to reset the order is:

cd /etc/rc.d/init.d; for f in *; do [ -x $f ] && /sbin/chkconfig $f resetpriorities; done

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/yum
  • /var/cache/dnf
  • /var/cache/mock
  • /var/lib/mock

Version specific notes

From pre-release

If you are upgrading to a final release from an alpha, beta, preview, or other Rawhide release, please see Upgrading from pre-release to final.

To rawhide

Warning.png
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 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 plugins metadata
# dnf --releasever=rawhide --setopt=deltarpm=false distro-sync --nogpgcheck

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


Fedora 22 -> Fedora 23

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-$(uname -i)
# dnf upgrade
# dnf clean all
# dnf --releasever=23 --setopt=deltarpm=false distro-sync --nogpgcheck

Fedora 21 -> Fedora 22

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$(uname -i)
# yum update yum
# yum clean all
# yum --releasever=22 distro-sync

Fedora 20 -> Fedora 21

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-$(uname -i)
# yum update yum
# yum clean all
# yum --releasever=21 distro-sync

Fedora 21 split into different products. Execute one of those commands:

# yum install system-release-workstation
# yum install system-release-cloud
# yum install system-release-server

or this one if you want to have non-productized Fedora

# yum install system-release-nonproduct

If you change your mind, you can easily switch between products.

# yum swap system-release-cloud system-release-workstation

Swapping to workstation sometimes may require you to use yum shell as it may require multiple packages to be swapped.

Many people report (e.g. bugs 1035326, 1044184, 1002331) that after upgrade some files have incorrect SELinux context. It is recommend to run:

 # restorecon -R /

Appear to be enable to shutdown/reboot gracefully afterwards:

# shutdown -h now
Failed to start poweroff.target: Connection timed out
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.

Upgrading from legacy end of life (EOL) Fedoras

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