How To Fedora: Upgrade to the New Version with Preupgrade

 

In this how To We will see how to update one or more previous versions of our Fedora to the current version or current. This is a translation of the article How to use PreUpgrade same that is available in the PTM Wiki de FedoraProject. The translation has been run on my own account, so if you find errors (I hope not) or corrections, please let me know in the comments :). Remember that all the commands contained in this post must be entered as root ;).

How to use Preupgrade?

pre-upgrade is an application that runs on an existing version, resolves, and downloads the necessary packages to upgrade to a new version of Fedora. During the preupgrade process, users can continue to use their systems. This gives you an experience similar to a live update. For additional information, please refer to page: preupgrade features.

Upgrade to current version directly

Preupgrade offers an update to the latest version of Fedora. No need to upgrade to intermediate versions. For example, it is possible to upgrade from Fedora 14 to Fedora 17 directly.

Previous requirements

The system cannot be upgraded with preupgrade in the following case:

Prepare the system

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

  • Backup - Before carrying out any maintenance work on the system, it is recommended to make a copy of all important data before proceeding.
  • Update - Apply the available updates before proceeding with the Fedora update. As root user, run the following command:

yum update

  • Installation - Starting with Fedora 10, the preupgrade utility is included in a Fedora installation by default. The package can also be installed manually using the yum command:

yum install preupgrade

Perform the update

Generally, package kit will notify you when updates are available for your system. However, if you decide to manually upgrade using preupgrade, follow the steps listed below.

  • Start the preupgrade utility as root by opening a terminal and executing the following command:

preupgrade

If you prefer an interactive command line application, the command preupgrade-cli is also available.

  • On the Choose Your Release screen, select the version of Fedora you want to update, and click the Apply button.
  • When all the packages have been downloaded, reboot the system to start the Fedora installer and update to the next version.

Note from <° FromLinux: If you want to go deeper into this process, please visit the following article: Preupgrade: Upgrading Between Fedoras, thanks to Diego Campos by the link;).

Note 2 of <°FromLinux: The upgrade process can also be done from the Fedora installation DVD.

Remote update

Preupgrade has a switch that allows a remote upgrade via VNC. If you are using preupgrade for a remote upgrade, it is most likely a machine that has a static IP address. This is handled through the preupgrade command:

preupgrade-cli --vnc[=password] --ip=[IPADDR] --netmask=[NETMASK] --gateway=[IPADDR] --dns=[DNSSERVER] "Fedora 17 (Beefy Miracle)"

Common post-upgrade tasks

After the update, additional measures are recommended to complete the process.

Unsupported package removal

Some packages may not be supported by the new version. You may want to remove these packages as you will stop receiving security updates, and they may cause later conflicts with the new packages. These can be identified with the following command:

package-cleanup --orphans

Browse .rpmsave and .rpmnew files

After completing the upgrade process, you may notice some file names ending in .rpmsave y .rpmnew. Do not be alarmed. The upgrade process will always preserve locally modified configuration files. File names ending in .rpmsave contain local configuration changes. Whereas the filenames ending in .rpmnew represent the configuration file in its original packaging with the software.

You should examine all the .rpmsave and .rpmnew files created by the update. Depending on the differences, you may need to manually combine the configuration files. You can locate all the files that match with the find command.

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

Optionally, to speed up repeated searches while editing, by running the updatedb command first, and then using locate to perform searches later.

updatedb

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

Check the update

Run:

yum repolist

To confirm that the repository configuration is correct. Then run:

yum distro-sync

To synchronize the packages with the versions in the repository.

Problem solving

Not enough space in / boot

Fedora 13 and higher use by default 500 MB in the boot partition (/ boot). The default value for the / boot filesystem size is 200MB in older versions, this can be a problem for users upgrading from that version. In many cases, the disk space that is freed up is likely enough to allow preupgrade to download the installer, but not enough to run the installer and install the new kernel at system startup. This section presents some familiar tips to get you started. Remember: When performing administrative tasks, be sure to back up your data before proceeding.

There are two basic methods of getting preupgrade to work in these cases. In the first method, you need to free up enough space for the installer to install the new kernel packages. In the second method, you have to temporarily occupy enough space in / boot to force preupgrade to download the installer after rebooting.

Method 1: Free up space

First, try to remove kernel packages that are not currently in use on your system. The script kernel-prune.py it can be used to identify kernels that can be safely removed. If you choose to remove the additional kernels, be prepared with the installation media in case you cannot revert to your previously installed system.

The installation program will require approximately 26 MB of free space in / boot. Use the following command to determine the amount of free space on the / boot partition:

df -h /boot

To identify the kernels that can 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:

PKGS='./kernel-prune.py'

echo $PKGS

yum remove $PKGS

Then adjust the number of reserved file system blocks using the tune2fs commands. First, you will need to identify the block device for the / boot file system. In the following example, / dev / sda1 is the block device for the / boot filesystem.

mount | grep "/boot"

/ dev / sda1 on / boot type ext4 (rw)

Now, adjust the number of blocks reserved for the / boot filesystem using the commands tune2fs. Normally, a small amount of space on partitions with the ext file format is 'reserved' and can only be used by the system administrator; This is to avoid a system that won't boot, and to allow the administrator some workspace in order to completely clean the partitions. However, none of these cases really apply to the / boot filesystem, so removing this reserved space is safe.

tune2fs -r 0 /dev/sda1

Finally, try removing unnecessary files from the / boot filesystem. This will largely depend on how your system is configured.

Deleting the wrong files can result in a system that will not boot. Some candidates for removal include / boot / efi y /boot/grub/splash.xpm.gz.

Method 2: Trick for preupgrade to download the installer

This method requires that you have a wired connection to the Internet during installation. If you are in wireless mode and cannot connect using an Ethernet cable, you will need to use method 1 instead.

First, find out how much space is available on the / boot filesystem. df is the desired command for this:

df /boot

Filesystem 1K-blocks Used Available Use% Mounted on
/ dev / sda1 198337 30543 157554 17% / boot

Secondly, create an archive that takes up enough space for preupgrade to decide that stage2 cannot be installed for now. Preupgrade requires approximately 120MB for the installation image so we are going to make sure we have less than 100MB of space available. For example, the file system, that means we need to fill 60 MB. Here's how to do it as root:

dd if=/dev/zero of=/boot/preupgrade_filler bs=1024 count=61440

df /boot

Filesystem 1K-blocks Used Available Use% Mounted on
/ dev / sda1 198337 92224 95873 50% / boot

Thirdly, run preupgrade as normal. In the early stages, before downloading the packages, preupgrade should tell you that there is not enough space to download the installer, but that you can download it when you restart the system if you have a wired connection. You can click continue. When preupgrade is ready, don't reboot right away. Instead, delete the file / boot / preupgrade_filler and make sure your computer is connected to the network using an Ethernet cable. Then you can reboot the system.

rm /boot/preupgrade_filler

In fourth place, the computer should boot into the setup program, connect to the Internet via the Ethernet cable, and begin downloading the stage2 installer image. Then the update should continue as normal.

Update does not install after reboot

Explanation

If you have a multiboot configuration, the menu file that GRUB / boot uses may be different from the menu that modifies preupgrade / boot. In this case, you will have to instruct grub to use the corresponding file to complete the update on boot. If this is not done, after preupgrade has completed the file download and installation, there will be no visible changes on boot. The system will simply reboot over the previous version.

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

The GRUB boot loader can be used to boot from the command line, or the /boot/grub/menu.lst file can be modified to create a boot menu option (Example of a screenshot of the GRUB boot menu) (For more details on GRUB, see the grub manual).

Any of the options regarding the grub can be used. For a better understanding of the subject, the following describes how to do it by command line and editing the menu.lst file.

However, since the update only needs to be run once and the system update will likely require a reboot, the most convenient method is probably to manually start the update via the grub command line, then once After the update is complete, add an option in the menu.lst file for the Fedora update. This would correspond to the method 1, steps 1-3, followed by method 2, step 4.

PASO 1: Identify the partition location

Identify the drive and partition of your Fedora / boot directory. (See the Grub Naming Convention for details). For example, if you have fully installed Fedora on partition fourteen of a second hard drive, / boot is at root (hd1, 13).

PASO 2: Boot from partition location

On rebooting, type "c" to enter the grub prompt. Using the appropriate numbers of drives and partitions, type the following commands:

root (hd1,13)
kernel / boot / upgrade / vmlinuz
initrd /boot/upgrade/initrd.img
boot

This will start the update installation.

PASO 3: Select the installation image

The update installation will launch an ncurses dialog. After selecting the language and keyboard type, select the hard drive for the installation method. The next dialog will require partition and directory information from the installation image. Select the partition from the drop-down menu. (Note that the numbering will start from the grub partition. In other words, root (hd1, 13) will appear as / dev / sdf14). Finally, enter the location of the installation image file: /boot/upgrade/install.img.

The installation will run normally at this point. After completing the upgrade, you will have to either boot the system or upgrade manually by entering the new kernel and initrd.img files on the grub command line, or add an entry to the menu.lst file. This step is detailed in the next section.

Method 2: Modify the GRUB menu.lst file

As an alternative to entering the commands at the GRUB prompt after reboot, you can also edit the GRUB menu.lst file to add an option that will allow you to select the start of the upgrade process from the GRUB boot menu. Since the update only needs to be run once, after updating you will need to re-edit menu.lst, remove the update boot option from the menu, and add a boot entry for the new kernel.

PASO 1: Identify the partition location

Identify the drive and partition of your Fedora / boot directory (See the Grub Naming Convention for details). For example, if you have fully installed Fedora on partition fourteen of a second hard drive, / boot is at root (hd1, 13).

PASO 2: Edit menu.lst

Find and open the /boot/grub/menu.lst file. If this file is on another partition, check the files in / media. Using the appropriate numbers of drives and partitions, write the following entry in the menu.lst file:

Title Fedora Upgrade
root,)
kernel / boot / upgrade / vmlinuz
initrd /boot/upgrade/initrd.img
savedefault
boot

Save the file and reboot the system. Select the Fedora update from the GRUB boot menu.

PASO 3: Select the installation image

The update installation will launch an ncurses dialog. After selecting the language and keyboard type, select the hard drive for the installation method. The next dialog will require partition and directory information from the installation image. Select the partition from the drop-down menu. (Note that the numbering will start from the grub partition. In other words, root (hd1, 13) will appear as / dev / sdf14).

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

PASO 4: Menu.lst cleanup

After the upgrade is complete, you will need to either boot the system or upgrade manually by entering the new kernel and initrd.img files on the grub command line, or by adding an entry to the menu.lst file.

The following is an example of a grub entry for a Fedora Core 10, located on partition fourteen 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 kernel and initrd files, these are in the / boot folder of the Fedora partition, and make an entry with the same title as the kernel and initrd files.

Finally, remove the update boot entry from menu.lst.

Sources: Cited within the article;).


Add as preferred source