How to use PreUpgrade

PreUpgrade is an application to be run on an existing release which resolves and downloads packages required to upgrade to a newer release of Fedora. During the PreUpgrade process, users are free to continue using their systems. This gives an experience similar to a live upgrade. For additional information, please refer to the PreUpgrade feature page.

= Prerequisites =

Your system cannot be upgraded with preupgrade if any of the following apply:


 * 1) If your /boot partition is on RAID.  See bug 500004.

= Prepare the system =

While preupgrade can provide a generally smooth upgrade experience, the following steps are recommended before proceeding.


 * 1) Backup - Before performing any system maintenance, it is recommended that you back up all important data before proceeding.
 * 2) Update - Apply available updates Fedora updates before proceeding.  As the root user, issue the following command: yum update
 * 3) Install - As of, the preupgrade utility is included in a default Fedora install.  The package can also be installed manually using the  command: yum install preupgrade

= Perform the upgrade =

Typically, you will be prompted by when upgrades are available for your system. However, if you choose to manually upgrade using, the steps are listed below.


 * 1) Start the Preupgrade utility as root by opening a terminal and issuing the following command: preupgrade If you prefer an interactive command line application, the command  is also available.
 * 2) On the Choose desired release screen, select the Fedora release you want to upgrade to, and click the Apply button.
 * 3) When all of the packages have downloaded, reboot your system to start the Fedora installer and upgrade to the next release.

Remote upgrade
has a switch that allows a remote upgrade via VNC. If you're using preupgrade for a remote upgrade, you'll more than likely be dealing with a machine that has a static IP. This is handled via the command:

preupgrade-cli --vnc[=password] --ip=[IPADDR] --netmask=[NETMASK] --gateway=[IPADDR] --dns=[DNSSERVER] "Fedora 15 (Lovelock)"

= Common post-upgrade tasks =

After the upgrade is complete, additional steps are recommended to complete the process.

Removing unsupported packages
Some packages may no longer be supported by the new release. You may wish to remove these packages because they will no longer get security updates, and they may cause later conflicts with supported packages. These can be identified with the following command: package-cleanup --orphans

Examine and  files
After completing the upgrade process, you may notice file names ending with and. Don't be alarmed. The upgrade process will always preserve any locally modified configuration files. The file names ending with contain your local configuration changes. While the file names ending with represent the configuration file originally packaged with the software.

You should examine all and  files created by the upgrade. Depending on the differences, you may need to manually merge configuration files. You can locate all matching files using the command.

find / -print | egrep "rpm(new|save)$"

You may wish to speed up repeat searches as you edit, by running the command first, and then using  for subsequent searches.

updatedb locate --regex "rpm(new|save)$"

Verify the upgrade
Run yum repolist to confirm repository settings are correct. Then run yum distro-sync to sync the packages with the versions in the repository.

= Troubleshooting =

Not enough space in /boot
Fedora 13 and above has a 500 MB default boot partition. The default filesystem size of 200MB for previous releases can be a problem for users upgrading from that release. In many cases, the diskspace that is likely free is just enough for preupgrade to find enough space to download the installer to but not quite enough for it to run the installer and install the new kernel after reboot. This section outlines several tips that have been known to work. As always when performing administrative tasks, be sure to back-up any data before proceeding.

There are two basic methods to make preupgrade work in this situation. In the first method, you need to free up sufficient space for the installer to install the new kernel packages. In the second method, you need to temporarily fill up enough of the space on to force preupgrade to download the installer after rebooting.

Method 1: Free up space
First, try to remove any kernel packages not currently in use on your system. The kernel-prune.py script can be used to identify kernels that may be safely removed. If you choose to remove additional kernels, be prepared with installation media should you be unable to return to your previously installed system.

The installer will need approximately 26M of free space in /boot. Use the following command to determine the amount of free space in the /boot partition:

df -h /boot

To identify kernels that may be safely removed, run the following from a command line: curl -O 'http://skvidal.fedorapeople.org/misc/kernel-prune.py' chmod a+x kernel-prune.py ./kernel-prune.py

Now, to actually remove the kernel versions listed by the above command, run the following as root:
 * 1) PKGS=`./kernel-prune.py`
 * 2) echo $PKGS
 * 3) yum remove $PKGS

Next, adjust the number of reserved filesystem blocks using the command. You'll first need to identify the block device for your file system. In the example below, is the block device for the  filesystem. /dev/sda1 on /boot type ext4 (rw) Now, adjust the number of reserved blocks for the filesystem using the command. Normally, a small amount of space on ext filesystem formatted partitions is 'reserved' and can only be used by the system administrator; this is to prevent an entirely full partition from rendering a system unbootable, and allow the administrator some space in which to work in order to clean up 'full' partitions. However, neither of this cases really applies to the filesystem, so removing this reserved space is safe.
 * 1) mount | grep "/boot"
 * 1) tune2fs -r 0 /dev/sda1

Last, try removing unnecessary files from the filesystem. This will largely depend on how your system is set up. Removing the incorrect files may result in a unbootable system. Some candidates for removal include and.

Method 2: Trick preupgrade into downloading the installer
This method requires you to have a wired connection to the internet during the install. If you are on wireless and cannot connect via an ethernet cable you will have to use Method 1 instead.

First, find out how much space is available on the filesystem. is the command you want for this: $ df /boot Filesystem          1K-blocks      Used Available Use% Mounted on /dev/sda1               198337     30543    157554  17% /boot

Second, create a file that takes up enough space that preupgrade decides it cannot install stage2 now. Preupgrade needs approximately 120MB for the installer image so we'll make sure we have a bit less than 100MB. For the example filesystem, that means we need to fill up 60MB. Here's how to do that as root: Filesystem          1K-blocks      Used Available Use% Mounted on /dev/sda1               198337     92224     95873  50% /boot
 * 1) dd if=/dev/zero of=/boot/preupgrade_filler bs=1024 count=61440
 * 2) df /boot

Third, run preupgrade as normal. In the early stages, before downloading packages, preupgrade should tell you that there wasn't enough room to download part of the installer but it can download it after reboot if you have a wired connection to the network. You can click continue for that. When preupgrade is done don't reboot immediately. Instead, remove the file and make sure your computer is connected to the network via an ethernet cable. Then you can reboot.
 * 1) rm /boot/preupgrade_filler

Fourth, the computer should boot into the installer, connect to the internet via the ethernet cable and start downloading the stage2 installer image. Then it should continue upgrading as normal.

Method 3 (for virtual machines): Use virt-resize
Use virt-resize to increase the space in the boot partition.

You should read the manual page carefully first, the following instructions are just an outline. The virtual machine must be shut down before you resize it.


 * 1) yum install /usr/bin/virt-resize
 * 2) lvrename /dev/vg_host/guest /dev/vg_host/guest.old
 * 3) virt-filesystems -a /dev/vg_host/guest.old --all --long -h

In the lvcreate command, choose a size about 1GB larger than the current size:


 * 1) lvcreate -L 10G -n guest /dev/vg_host

For a Fedora &le; 15 guest that has partition 1 = boot and partition 2 = physical volume, you could use a command like this, but please read the manual:

--resize /dev/sda1=+300M --expand /dev/sda2
 * 1) virt-resize /dev/vg_host/guest.old /dev/vg_host/guest \

Check that resizing was successful and that the guest boots before deleting the old guest.


 * 1) lvremove /dev/vg_host/guest.old

Explanation
If you have a multiboot configuration, the  menu that grub uses might be different from the   menu that preupgrade modifies. In this case, you will need to point grub to the appropriate file to complete upgrade upon reboot. If this is not done, once preupgrade has completed downloading and installing files, upon reboot no change will be visible. The system will simply reboot as to the older version.

Preupgrade boots into an upgrade kernel as an intermediate step. Once the system has been upgraded, preupgrade replaces the temporary upgrade kernel option with an option for the upgraded kernel. In other words, there are two modifications made to the bootloader: a temporary upgrade option, followed by an option that is permanent until the next upgrade.

The grub bootloader can be used to boot from its command line, or  can be modified to create a boot menu option. (For further detail on grub, refer to the grub manual.)

Either grub option can be used for either preupgrade step. To be comprehensive, the following describes both the command line option and doing so by editing the  file.

However, since the upgrade should only be run once, and the upgraded system will probably require repeated booting, the most expedient approach is probably to manually boot the upgrade via the grub command line, then once the upgrade has completed, to add an option to  add the upgraded Fedora installation to the grub boot menu. This would correspond to using Method 1, Steps 1 - 3, followed by Method 2, Step 4.

Method 1: Boot Manually from Grub Command Line
STEP 1: Identify Partition Location

Identify the drive and partition of your Fedora  folder. (See Grub Naming Convention for details.) For example, if you installed Fedora entirely on the fourteenth partition of a second hard drive,  would be located on

STEP 2: Boot from Partition Location

Upon reboot, enter 'c' to enter the grub command line. Using the appropriate drive and partition numbers, enter the following commands: root (hd1,13) kernel /boot/upgrade/vmlinuz initrd /boot/upgrade/initrd.img boot

This will boot the upgrade installation.

STEP 3: Select Installation Image

The upgrade installation will then run an ncurses dialog. After selecting language and keyboard types, select  for. The next dialog box will require partition and directory information of the installation image. Select the partition from the drop-down menu. (Note that the numbering will be one off from the grub partition. In other words  will appear as  .) Finally, enter the location of the install image file:.

The installation will run normally at this point. After completing the upgrade, you will need to either boot the upgraded system manually by entering the newly installed  and   files at the grub command line, or add an entry to the   file. This step is detailed in the next section.

Method 2: Edit the Grub File
As an alternative to entering the commands at the grub command prompt upon reboot, you can also edit grub's  file to add an option that will allow you to select booting to the upgrade process from grub's boot menu. Since the upgrade should only be run once, after you've upgraded you will then need to re-edit, remove the upgrade boot menu option, and add a boot entry for the new kernel.

STEP 1: Identify Partition Location

Identify the drive and partition of your Fedora  folder. Grub Naming Convention. For example, if you installed Fedora entirely on the fourteenth partition of a second hard drive,  would be located on

STEP 2: Edit 

Locate and open the  file that grub actually uses. If this file is on another partition, check the  files.

Using the appropriate drive and partition information in the  line format, add the following entry to the   file:

title Fedora Upgrade root (hd*,*) kernel /boot/upgrade/vmlinuz initrd /boot/upgrade/initrd.img savedefault boot

Save the file, and reboot. Select the  from the grub boot menu.

STEP 3: Select Installation Image

The upgrade installation will then run an ncurses dialog. After selecting language and keyboard types, select  for. The next dialog box will require partition and directory information of the installation image. Select the partition from the drop-down menu. (Note that the numbering will be one off from the grub partition. In other words  will appear as  .)

Finally, enter the location of the install image file:. The installation will run normally at this point.

STEP 4: Cleanup 

After completing the upgrade, you will need to either boot the upgraded system manually by entering the newly installed  and   files at the grub command line, or by adding an entry to the   file.

The following is an example of a grub entry for a Fedora Core 10 installation, located on the fourteenth partition of the second hard drive.

title Fedora Core 10 (on /dev/sdb14) root (hd1,13) kernel /boot/vmlinuz-2.6.27.5-117.fc10.x86_64 ro quiet splash initrd /boot/initrd-2.6.27.5-117.fc10.x86_64 savedefault boot

Locate the updated  and   files located in the   folder of the Fedora partition, and create an entry with modified   and   lines that will match those of the upgrade.

Finally, remove the upgrade boot entry from.