Updating your system

From Mandriva Community Wiki

Jump to: navigation, search


Updating your system is crucial to get the best of Mandriva Linux and to obtain the latest security fixes. New updates are produced only during the lifetime of the product as specified by the Product Lifetime Policy.


Contents

Updating the distribution's packages

Update using the Mandriva Online applet

The Mandriva Online service is an easy way to update packages on your Mandriva Linux distribution. It automatically notifies the user of available updates and helps install those updates which correct bugs, install newer versions of software, and patch security problems in the system. It is as if you performed the update via the Mandriva Control Center, which we will describe in the next section, with less need for user intervention.

From the first launch of Mandriva, the update applet appears at the bottom right of your system tray:

Image:Recordmydesktop_arreter_enregistrer.png


  • Image: Noconf.png means that your Sources are not configured. Since Mandriva 2007 Spring, the first click on the Mandriva Online applet launches the interface to configure your sources exactly as if you clicked Menu > Tools > System Tools > Configure your computer and then Configure media sources.


Once your sources are configured, the applet will automatically check for new updates. If new updates are available, the applet will show you another icon:

  • Image:Busy.png means the applet is currently searching for new updates.
  • Image:Upgrade.png means that a new version of Mandriva Linux is available and that you have the opportunity to upgrade.
  • Image:Error.png means that new updates are available for your system. Click once on the applet and enter your user password. The update window will then display the list of available update with descriptions.

A right click allows you to check updates again, configure the applet, and close it.


Tip !
  • If the Online applet icon does not appear in the notification area of the taskbar, open the application launcher (Alt+F2) and type mdkapplet. Your icon will appear in the task bar tray and you will be able to right click the icon to select Launch applet on startup. You can also type mdkapplet - F in the console which will have the same effect (see the Man Page).
  • If the applet returns an error message indicating that the urpmi database is locked, refer to Man Page to find how to unlock it.

Updating via the Mandriva Control Center

Updating through the Mandriva Control Center also allows updates which correct bugs, install new versions of the software, and install patches to fix security issues in the system.

To update your system, go to Mandriva Control Center (Configure Your Computer), Click Software Management and launch Update your system Image:drakrpm-update-icon.png drakrpm-update

The first time that you launch the tool, it will require you to configure a source of file repository updates (also called a "mirror"). You should choose a site close to you (a .fr if you are in France, for example), to allow for quicker downloads. Technically, you could choose any mirror randomly because in theory, all the mirrors are synchronized.

Subsequently, the tool will simply require you to make sure that you are connected to check whether new updates are available.

In any case, the update tool Image:drakrpm-update-icon.png drakrpm-update will present the updates available as follows:

The window displaying the list of available updates.
Please note!
Mandriva's update tool always installs the most up-to-date version available.

Updating Using the Command Line

Consult the articles


Preventing certain packages from being updated

It is possible to prohibit the update of certain packages. It is unusual, but under certain circumstances it might be desirable to keep an older package rather than update to the latest and greatest.

To prevent updating a package, edit the file /etc/urpmi/skip.list and enclose the name of the package between two slashes. For example:

/kmail/
Please note!
It is possible to use rational expressions in the /etc/urpmi/skip.list. It should be understood that the word or the expression will be "matched" with a list of packages of the form name-version-release.arch. This enables you to specify an architecture, a release, etc.

Update to a New Version of Mandriva

Caution !
Updating a complete system is a serious operation. If you are not completely comfortable with what you are doing, you might want to reconsider and opt for a fresh install instead. Whatever you decide, it is highly recommended that you perform a complete system backup before you begin. At the very least, you should maintain a backup of the users' /home directories.


Automatic Update

Automatic updates of Mandriva via the Mandriva Applet (also called Mandriva Online) allows upgrading to a current version of Mandriva, since version 2008.1. When a new version of Mandriva is available, the applet's icon will become a blue arrow like below:


A dialog box will appear to ask to you whether you really wish to upgrade:

After pressing "Okay", the upgrade begins.

Please note!
Please make sure that you have disc space available on the partition "/" (or "/var" if it is separate). The idea is to have as much free disc space as occupied disc space (in other words free space should be 50% of total space).
Caution !
The applet may indicate success and instruct you to restart the system when in fact all packages are not yet installed. As long as the blue arrow is showing packages remain to be installed, therefore, do not restart as long as you see that icon. If the icon is orange, have patience: the applet is searching for packages to update. This may take several minutes.


Updating Via the Mandriva Installer

This is the method recommended for beginners because it is easy, is supported by Mandriva, and requires little knowledge of the system.


It is possible to use the Mandriva installer to update the system. The installer program will detect your current version of Mandriva and will offer the option to update it. To launch the Mandriva installer, use one of many the methods described in Installing Mandriva.


Tip !
It is strongly recommended to have separate partitions for " /" and for " /home". This makes it possible to keep the system files separate from user data.

At the time the update is executed, your personal data (files, parameters, etc) will be preserved. Your system configuration (where you have saved or changed parameters with Mandriva Control Center) will also be preserved to the extent possible. Nevertheless, the configuration files of certain applications will have to be updated. In this case, your old configuration files will be found renamed with the ".rpmsave" suffix.


Tip !
The "etc-update" package contains a small script etc-update which is quite practical. It will compare new package configuration files to old configuration files and will require you to take some action (delete the existing configuration, reuse the existing configuration, or merge both files). However, it requires a good knowledge of the configuration files because edits will be made manually.


You are not required to use the same repository for updates as that used for your installation. You could have installed with the liveCD and updated from a network repository, for example.

Changing Sources

This is the simplest method, but not as well supported. Indeed, the Mandriva installer (preceding method) performs tests and corrections more thoroughly than urpmi or drakrpm used in this method.

Tip !
The number of packages installed via this method will be relatively important. Urpmi or drakrpm often show their limits in this case. It is advised that you may need to start the update again several times in succession until there are no more updates reported available.


Updating Via the Mandriva Control Center

Use Image:drakrpm-edit-media-icon.png drakrpm-edit-media to change the address of repositories, by replacing 2008.0 for instance with 2008.1 in the address of the repository.


Launch Image:drakrpm-edit-media-icon.png drakrpm-edit-media to obtain a list of sources:


The tool to manage your media sources, necessary to fetch the package.


Then, edit each source in turn:


Replace the existing value with new (in this example, they replace devel / cooker with official / 2008.0):


To help you, here is the list of repositories identified for every distribution:

Distribution Value to be identified in address
Mandriva Linux 2008 Spring official/2008.1
Mandriva Linux 2009 official/2009.0
Mandriva Linux 2009 Spring official/2009.1
Mandriva Cooker devel/cooker

It is necessary to edit each of the sources in the window. Then click "Ok". They will then appear in Mandriva Control Center.

It is then necessary to launch an update with Image:drakrpm-update-icon.png drakrpm-update, or with the command urpmi --auto-select as above.


On the Command Line

It is necessary to do the following as root.


  • Make a copy of your good urpmi.cfg (configuration file of the repositories):
    cp /etc/urpmi/urpmi.cfg /etc/urpmi/urpmi.cfg.bak
  • Remove all existing media sources (repositories):
    urpmi.removemedia -a
  • Configure available sources by pointing your browser to easyurpmi and following the instructions there.
  • If you installed the Powerpack edition, use the club.commercial source on MirrorFinder.
  • To launch the update itself, you have two options. The first option allows more control over what happens:
  1. Either you know various Mandriva packages and you will be able to answer some questions of urpmi concerning the conflicts and dependencies. Then launch the command:
    urpmi --auto-select
  2. Or you do not wish to deal with questions, and let urpmi make a "safe bet" by prohibiting the installer from uninstalling software:
    urpmi --auto-select --keep
  • Finish the kernel update by installing kernel-latest. Normally, this package is already installed if you had Mandriva 2007 Spring (or later) before the update, but as a safeguard to ensure you have the latest kernel, it doesn't take much time and will do no harm to launch the command:
    urpmi kernel-latest
    .
  • That's it. Restart the system and meet the new version of Mandriva Linux.
Tip !
You can confirm the version of Mandriva Linux you have installed by typing the command cat /etc/mandriva-release.

Updating an existing Mandriva Free installation to Mandriva Powerpack

Assume you have a present Mandriva Free installation and then subscribed to Mandriva Powerpack. No need to install everything from scratch but it is sufficient to run the upgrade helper application (be sure that the computer is connected to the Internet):

/usr/bin/mdkapplet-restricted-helper 2010.0
(substitute 2010.0 with the version number you have, use
cat /etc/release
to find out)

Then a dialog window will open and ask you for your email address and password which has been used for the powerpack registration. Now the related repository lists will be downloaded and added to the list of paket sources.

Complete System Reinstallation

Technically, this is not an update, it is a fresh installation. The method is mentioned here because sometimes it is still used to update systems. To carry out this type installation, you must have a /home partition separate from the others:

  • Safeguard all important data by copying it into the /home partition.
  • Generate a list of packages currently installed on the system and save it somewhere under the /home partition.
  • Install Mandriva Linux according to one of the methods mentioned in Installation
  • During the "Partitioning" stage of installation, format all partitions except the /home partition.
  • Supplement the installation with the packages which were present before, according to the list generated previously.
  • Restore the important data previously safeguarded

You will find the method described in detail in the page: Installing Mandriva Linux.


Risks Incurred by this Update

This update consists of replacing all the software, the libraries, and the data files with new versions. This is not a minor operation, therefore, it is necessary to be conscious of the enormous risks one takes when making such an update (even if the update becomes increasingly simple and reliable as it has under Mandriva).

Caution !
Remember to backup any important data or configuration files.


  • Equipment not working any more or not any better: This problem is generally dependent on the kernel or packages for detection/hardware configuration such as udev or pulseaudio. It is important to report bugs in order to solve problems like this. This problem is also called a "regression" and is what Mandriva tests try to avoid at all costs.
  • Loss of the configuration of certain applications: The configuration files sometimes cannot be updated because of irreconcilable differences between versions (for example, updating apache 1.X to 2.X). For the system applications, a new configuration file, quasi-virgin, is installed and the old configuration file is copied with the extension ".rpmsave". The program etc-update allows the detection of these configuration files and proposes their resolution (but you must know its syntax and repair is done manually). For the application's users (who do not require complete access to the machine), problems can also appear for the same reasons.
  • Problems involving insufficient disc space: When adequate disk space is not available, the update (installer, urpmi or rpmdrake) is unable to install all packages. To overcome this problem, anticipate adequate free disc space in the partition / or /var (if the latter is separated from /) and when the update is finished, continue to update packages (described at the beginning of this page) until no more packages remain to be installed.

How to Update from Version N to N + 1

Since version 2009 (therefore this does not concern Mandriva 2008.1 or previous) Mandriva offers to upgrade automatically from version N to n + 1 via the automatic update applet. Before applying the upgrade, the applet asks for confirmation in a window. If you do not want to perform this upgrade, check the box "do not ask again" then click on "Not". You will receive no more such notification but you will still have opportunity to upgrade to a new version when it becomes available.

Image:Upgrade2.png

If you wish to completely disable this function for your whole system (and not only for one user) for example on the 2008.1 version, while still receiving updates for 2008.1, it is necessary to modify the file /etc/sysconfig/mdkapplet by changing the value false to true variable for the line "DO_NOT_ASK_FOR_DISTRO_UPGRADE".

Update the Linux Kernel

The Linux kernel is a specific type of update. The kernel must be updated deliberately. It is recommended that users read the following paragraphs as well as the article "The Mandriva Kernel" before undertaking a kernel update.


Risks Associated with this Update

The installation of a new kernel should not cause any problems as long as the system is not executed under that kernel. To execute the system under a specific kernel, it is necessary to restart the machine and choose the entry in the grub menu list which corresponds to the new kernel (note that all previously installed kernels remain available in the menu, but the last kernel installed is selected by default). If you experience problems, reboot and select a previous kernel from the menu list.


Regression

Even if there are few risks of serious problems, you may find that a peripheral which functioned perfectly before the update does not function afterward. This problem is called “regression” and must be avoided (as users are frustrated when they update a system that functioned perfectly only to find it broken after an "update"). It is one of the reasons, for example, that Mandriva 2007 Spring has the same kernel as the 2007 release (with some additions). This makes it possible to have the same hardware compatibility in both versions.


DKMS

DKMS was introduced in the 2005 release because updating the kernel still posed some risk of error at the time, even for experienced users. To avoid this error, DKMS allows the automatic compilation of the drivers on your system which must be recompiled for compatibility with the new kernel. This is particularly useful if you use the proprietary NVIDIA or ATI graphics drivers on your system (or import drivers from packages other than the Linux kernel, for example the gspca drivers for USB cameras). Previously, one had to compile the drivers themselves, or never update or change a kernel. This utility helps automate the update process. But understand, DKMS requires the kernel source code to function.


For this reason, always install kernel-devel ((or kernel-source) corresponding to the kernel which you use when you update the kernel in order to install the kernel source code on your system. If you do not, DKMS will not be able to compile the drivers automatically for your new kernel, and the hardware managed by those drivers might not work when you restart your system under the new kernel (which is the default choice during boot). Consequently, if you use a driver for a graphics card you could be unable to start the graphic server and be stuck in text mode.


To discover kernels and sources installed on your system, use the command

Image:Konsole.png
[root@computer ~]# rpm - qa ¦ grep ^kernel ¦ grep - v latest

You must have a "Devel" version for every version of kernel installed (see Nomenclature of the Mandriva Linux Kernel).


It is possible to automate the update of kernel and sources together as necessary for DKMS , by installing virtual packages kernel - (version) - latest and kernel - (version) - devel-latest, for instance:

 kernel-desktop-latest-2.6.22.16-1mdv2008.0
kernel-desktop-devel-latest-2.6.22.16-1mdv2008.0


Mandriva Linux 2008 changed the implementation of DKMS with the introduction of '"dkms binaires'" packages. To avoid confusing users with the installation of compilers and kernel source code, DKMS modules are compiled by Mandriva, wrapped, and published on mirrors. Contrary to the old system of packages, Dkms sources, Dkms binary packages are valid only for individual kernels and must, therefore, be installed with Image:drakrpm-update-icon.png drakrpm-update or Urpmi when kernel is installed.


Virtual packages -latest (ex: fglrx-kernel-desktop-latest or nvidia96xx-kernel-desktop-latest) allow the automatic installation of the last available corresponding version of the Dkms package. They are installed by default on Mandriva 2008. The -latest system is also used by the kernel under Mandriva to automate the installation of the most recent available kernel. The old system of Dkms package sources is kept if you decide to install an unsupported kernel (in effect, Dkms binary packages will be published only for supported kernels, in "hand", which excludes kernels -tmb, for instance.)


More information on DKMS...

Oops !

This problem is now extremely rare: A "kernel panic" (the equivalent of the Blue Screen Of Death under Windows), is often a problem with a driver bug. Generally this type of problem can only be solved by the Linux kernel developers.

Return to a Previous Kernel

It is always possible to choose the previous kernel in the first menu encountered when booting the machine (the boot loader menu) if the new kernel has a problem. In effect, all kernels are installed in parallel and kernels are not uninstalled (in other words, the new does not replace the old). Then, using the utility Image:drakboot --boot-icon.png drakboot --boot, it is possible to select your preferred kernel as default (it will be chosen by default during every start of the machine).

Updating Mandriva Linux on 2007 Spring or Newer

For Mandriva Linux 2007 Spring a simpler way to update the kernel was introduced (see Version Notes for more information). It is necessary to install package kernel-latest and as soon as a new kernel is made available by the Mandriva development team, it will be offered for download with Image:drakrpm-update-icon.png drakrpm-update. Note that it will not be chosen for update by default as other updates will because installation of a new kernel must be voluntary.

There is one package related to the kernel source: kernel-source-latest. In most cases, it should also be installed. See notes above.

From Mandriva Linux 2008, this package is installed by default and you only have to deal with these details in the rare case of a problem.

Updating Versions Prior to 2007 Spring

For versions of Mandriva previous to 2007 Spring, you must use urpmi or Image:drakrpm-icon.png drakrpm to deliberately install a new kernel. The best way to know if a new kernel is available for you is to verify directly on a mirror that there is a package called kernel-2.6. XX-Ymdv with the subsequent number version of your kernel (you acquire your kernel version number with uname - r). Then, you can follow the availability of new kernels by subscribing to the list "security-announce" (to see Help) or by using the flux RSS feed of Sophie.

One simple way to update the kernel from the command line using urpmi in an older version of Mandriva goes like this:

  • Find your kernel version
Image:Konsole.png
[root@computer ~]# rpm -qa 'kernel*'

For example in this list:

kernel-2.6.24.7-2mnb-1-1mnb1
kernel-headers-2.6.24-6mnb1
kernel-desktop-devel-2.6.24.7-1mnb-1-1mnb1
kernel-desktop-latest-2.6.24.7-2mnb1
kernel-desktop-devel-2.6.24.7-2mnb-1-1mnb1
kernel-desktop-2.6.24.7-2mnb-1-1mnb1
kernel-desktop-devel-latest-2.6.24.7-2mnb1

The most recent kernel installed on this system is "kernel-desktop-2.6.24.7-2mnb-1-1mnb1". You know this because the patch number (2.6.24.7-2nmb-1-1mnb1) is the highest in the list.

  • Fetch a list of updates
Image:Konsole.png
[root@computer ~]# urpmi –update kernel

This command spits out a long list of files followed by a list of 37 prospective kernels:

one of the following packages is needed:
 1- kernel-desktop586-2.6.24.5-1mnb-1-1mnb1.i586: Linux kernel for desktop use with i586 & 1GB RAM (to install)
 2- kernel-server-2.6.24.7-2mnb-1-1mnb1.i586: Linux Kernel for server use with i686 & 64GB RAM (to install)
 3- kernel-laptop-2.6.24.7-2mnb-1-1mnb1.i586: Linux kernel for improved laptop battery runtime with i686 & 4GB RAM (to install)
 4- kernel-laptop-2.6.24.4-3mnb-1-1mnb1.i586: Linux kernel for improved laptop battery runtime with i686 & 4GB RAM (to install)
 5- kernel-server-2.6.24.5-1mnb-1-1mnb1.i586: Linux Kernel for server use with i686 & 64GB RAM (to install)
 6- kernel-server-2.6.24.5-2mnb-1-1mnb1.i586: Linux Kernel for server use with i686 & 64GB RAM (to install)
 7- kernel-desktop-2.6.24.4-3mnb-1-1mnb1.i586: Linux Kernel for desktop use with i686 & 4GB RAM (to install)
 8- kernel-server-2.6.24.4-3mnb-1-1mnb1.i586: Linux Kernel for server use with i686 & 64GB RAM (to install)
 9- kernel-desktop586-2.6.24.4-3mnb-1-1mnb1.i586: Linux kernel for desktop use with i586 & 1GB RAM (to install)
 10- kernel-desktop586-2.6.24.7-1mnb-1-1mnb1.i586: Linux kernel for desktop use with i586 & 1GB RAM (to install)
etc., etc., etc.
  • Pick the same kernel observed in the first command with the higher patch number

The next step would be to pick through that list of 37 kernels and find the option that is closest to "kernel-desktop-2.6.24.7-2mnb-1-1mnb1" with a larger patch number. For example if I saw:

34- kernel-desktop-2.6.24.7-3mnb-1-1mnb1

I would choose "34" and press enter. The kernel would then download and install.

If you use lilo as your boot loader, an new/old selection is added to the bottom of the menu and updates the Master Boot Record.

Reboot, pick the new kernel at the bottom of the menu, and if it works, edit your /boot links for vmlinuz and initrd.img are automagically move to the new kernel.

If works, you may choose to remove the two bottom entries from /etc/lilo.conf and do a lilo -v.

Of course, if you are running a recent version of Mandriva, this step is still possible, but hardly necessary.

Personal tools