next up previous contents index
Next: Configuration Up: Installation Previous: The Installation   Contents   Index

Subsections


Updating the System and Package Management

SuSE Linux provides the option of updating an existing system without completely reinstalling it. There are two types of updates: updating individual software packages and updating the entire system. Packages can also be installed by hand using the package manager RPM.


Updating SuSE Linux

Software tends to ``grow'' from version to version. Therefore, we recommend first taking a look at the available partition space with df before updating. If you suspect you are running short of disk space, secure your data before updating and repartition your system. There is no general rule of thumb regarding how much space each partition should have. Space requirements depend on your particular partitioning profile, the software selected, and the version numbers of SuSE Linux.


Note

It is recommended to read the README and, in DOS and Windows, README.DOS file on your CD. Find notes there regarding any additional changes made after this manual went to print.


Preparations

Before you begin your update, copy the old configuration files to a separate medium just to be on the safe side. Such media can include streamers, removable disks, floppy drives, or ZIP drives. This primarily applies to files stored in /etc. Also, review the configuration files in /var/lib. Furthermore, it you may want to write the user data in /home (the HOME directories) to a backup medium. Back up this data as SuSE @nohyphen root. Only SuSE @nohyphen root has read permission for all local files.

Before starting your update, make note of the root partition. The command df / lists the device name of the root partition. In the example shown in Output 2, the root partition to write down is /dev/hda7. aus:update.dfList with df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 1.9G 189M 1.7G 10% /dos
/dev/hda7 3.0G 1.1G 1.7G 38% /
/dev/hda5 15M 2.4M 12M 17% /boot
shmfs 141M 0 141M 0% /dev/shm
The root partition can be recognized as the one mounted as /.


Possible Problems

PostgreSQL

Before updating PostgreSQL (package postgres), it is usually best to ``dump'' the databases. See pg_dump. This is, of course, only necessary if you actually used PostgreSQL prior to your update.

Promise Controller
The hard disk controller manufactured by Promise is currently found on high-end motherboards in numerous computer models, either as a pure IDE controller (for UDMA 100) or as an IDE-RAID controller. As of SuSE Linux 8.0, these controllers are directly supported by the kernel and treated as a standard controller for IDE hard disks. The additional kernel module pdcraid is required before you can aquire RAID functionality.

For some updates, hard disks on the Promise controller may be detected before disks on the standard IDE controller. If so, the system will no longer boot following a kernel update and usually exit with Kernel panic: VFS: unable to mount root fs. In this case, the kernel parameter ide=reverse must be passed when booting to reverse this disk detection process. See 1. To apply this parameter universally when using YaST, enter it in the boot configuration. See (), chapter User-Defined Installation, Booting (Boot Loader Installation).


Caution

Only the controllers activated in the BIOS are detectable. In particular, subsequently activating or deactivating the controllers in the BIOS has a direct effect on the device names. Use caution or risk being unable to boot the system.

Technical Explanation
The controller sequence depends on the motherboard. Each manufacturer wires its supplementary controllers differently. The lspci shows this sequence. If the Promise controller is listed before the standard IDE controller, the kernel parameter ide=reverse is required after updating. With the previous kernel (without direct Promise support), the controller was ignored so the standard IDE controller was detected first. The first disk was then /dev/hda. With the new kernel, the Promise controller is detected immediately and its (up to four) disks are registered as /dev/hda, /dev/hdb, /dev/hdc, and /dev/hdd. The previous /dev/hda disk becomes /dev/hde so is no longer detectable in the boot process.


Updating with YaST

Following the preparation procedure outlined in 2, you can now boot:

  1. Boot the system for the installation (see User Guide). In YaST, choose a language, then select ` Update Existing System'. Do not select ` New Installation'.

  2. YaST will determine whether there are several root partitions. If there is only one, continue with 3. If there are several, select the right partition and confirm with ` Next' (/dev/hda7 was selected in the example in 2).

    YaST reads the ``old'' fstab on this partition to analyze and mount the file systems listed there.

  3. Then you have the possibility to make a backup copy of the system files during the update. This option slows down the update process. Use this option if you do not have a recent system backup.

  4. In the following dialog, either choose to update only the software that is already installed or to add important new software components to the system (``upgrade mode''). It is advisable to accept the suggested composition (e.g., ` Standard System'). Adjustments can be made later with YaST.

    Figure 2.1: Updating the Software
    \includegraphics[width=.8\linewidth]{u_y2_software}


Manual Update


Updating the Base System

Because basic system components, such as libraries, must be exchanged when updating a base system, an update cannot be run from within a currently running Linux system. First, set up the update environment. This is normally done using the CD or DVD or with a custom boot disk. If you are carrying out manual modifications during the update or prefer to perform the entire update with YaST in text mode, follow the steps already described in detail in 1. Below is a summary of this procedure.

  1. Immediately after booting the kernel from the ``boot disk'' or from the CD or DVD, linuxrc automatically starts.
  2. In linuxrc, specify the language and keyboard settings under ` Settings' and click ` Ok' to confirm each setting.
  3. You might need to load the required hardware and software drivers via ` Kernel Modules'. See section 1 for more details on how to proceed and 11 for a description of linuxrc.
  4. Go to the menu items ` Start Installation / System' ->` Start Installation/Update' to select the source medium (see sec:linuxrc.start).
  5. The installation environment is loaded from linuxrc then YaST started.

Following the selection of a language and the hardware detection by YaST, select ` Update existing system' in the YaST opening screen.

Next, YaST attempts to determine the root partition and displays the result for selection or confirmation. Select your root partition from the list (for example, /dev/sda3). In this way, prompt YaST to read the ``old'' fstab from this partition. YaST will analyze and mount the file systems listed there.

Then you have the possibility to make a backup copy of the system files during the update. In the following dialog, either choose to update only the software already installed or to add important new software components to the system (``upgrade mode''). It is advisable to accept the suggested composition (e.g., ` Standard system'). Adjustments can be made later with YaST.

In the warning dialog, select ` Yes' to start the installation of the new software from the source medium to the system hard disk.

First, the RPM database is checked, then the main system components are updated. YaST automatically creates backups of files modified in the running system since the last installation. In addition, old configuration files are backed up with the endings .rpmorig and .rpmsave (see 2). The installation or update procedure is logged in /var/adm/inst-log/installation-* and can be viewed later at any time.


Updating the Rest of the System

After the base system is updated, you will be switched to YaST's update mode. This mode allows you to tailor the rest of the system update to your needs.

Complete the procedure as you would a new installation. Among other things, select a new kernel. The available options are presented by YaST.


Tip

If you boot with loadlin, save the new kernel and, possibly, the initrd into the loadlin directory of your DOS partition.


Possible Problems


Updating Individual Packages

Regardless of your overall updated environment, you can always update individual packages. From this point on, however, it is your responsibility to ensure that your system remains consistent. Update advice can be found at http://www.suse.de/en/support/download/updates/.

Select components from the YaST package selection list according to your needs. If you select a package essential for the overall operation of the system, YaST issues a warning. Such packages should be updated only in the update mode. For instance, numerous packages contain ``shared libraries''. If you update these programs and applications in the running system, things might malfunction.


Software Changes from Version to Version

The individual aspects changed from version to version are outlined in the following sections in detail. This summary indicates, for example, whether basic settings have been completely reconfigured, whether configuration files have been moved to other places, or whether common applications have been significantly changed. Only the modifications that would affect the daily use of the system at either the user or the administrator level are mentioned below. The list is by no means complete. The following also makes references to SDB (Support Database) articles. These articles are in the package sdb_en, series doc ().

Problems and bugs for each version have been published on the web server as soon as they were recognized. See the links listed below. Important updates of individual packages can be accessed at http://www.suse.de/en/support/download/.


From 7.3 to 8.0

Problems and Special Issues:
http://sdb.suse.de/sdb/en/html/bugs80.html.


From 8.0 to 8.1

Problems and Special Issues:

http://sdb.suse.de/sdb/de/html/bugs81.html.


From 8.1 to 8.2

Problems and Special Issues:
http://sdb.suse.de/sdb/en/html/bugs82.html.


From 8.2 to 9.0

Problems and Special Issues:
http://sdb.suse.de/sdb/en/html/bugs90.html.

  • Version 4 of the RPM package manager is now available. The functionality for building packages has been shifted to the separate program rpmbuild. rpm continues to be used for the installation, updates, and database queries. See section 2.

  • The package footmatic-filters is now available for printing. The content was split from the package cups-drivers, as it can be used for printing even if CUPS is not installed. In this way, YaST supports configurations that are independent from the print system (CUPS, LPRng). The configuration file for this package is /etc/foomatic/filter.conf.

  • The packages footmatic-filters and cups-drivers are now also required for LPRng/lpdfilter.

  • The XML resources of the enclosed software packages can be accessed by means of the entries in /etc/xml/suse-catalog.xml. This file should not be edited with xmlcatalog, as this would result in the deletion of structural comments required for correct updates. /etc/xml/suse-catalog.xml is accessed by means of a nextCatalog statement in /etc/xml/catalog, enabling XML tools like xmllint or xsltproc to find the local resources automatically.

(Der neue Wert ist 200112 und wird als Vorgabe für _POSIX2_VERSION angenommen.)

Den SUS-Standard kann man hier nachlesen (frei, aber eine Registrierung ist erforderlich):

Hier eine kurze Gegenüberstellung:

POSIX 1992 POSIX 2001
chown tux.users chown tux:users
tail +3 tail -n +3
head -1 head -n 1
sort +3 sort -k +3
nice -10 nice -n 10
split -10 split -l 10


Tip

Software von Drittanbietern folgt möglicherweise noch nicht dem neuen Standard; in einem solchen Fall ist es ratsam, die Umgebungsvariable wie oben beschrieben zu setzen: _POSIX2_VERSION=199209.


RPM -- the Package Manager

In SuSE Linux, RPM (Red Hat Package Manager) is used for managing the software packages. Its main programs are rpm and rpmbuild. Thus, the powerful RPM database can be queried by the users, the system administrators, and package builders for detailed information on the installed software.

Essentially, rpm has five modes: installing, uninstalling or updating software packages, rebuilding the RPM database, querying RPM bases or individual RPM archives, integrity checks of packages, and signing packages. rpmbuild can be used to build installable packages from pristine sources.

Installable RPM archives are packed in a special binary format. These archives consist of the program files to install and certain meta information used during the installation by rpm to configure the software package or stored in the RPM database for documentation purposes. RPM archives normally have the extension .rpm.

rpm can be used to administer LSB-compliant packages. Refer to 11 for more information on LSB.


Tip

For a number of packages, the components needed for software development (libraries, headers, include files, etc.) have been put into separate packages. These development packages are only needed if you want to compile software yourself, for example, the most recent GNOME packages. They can be identified by the name extension -devel, such as the packages package alsa-devel, package gimp-devel, and package kdelibs-devel.


Verifying Package Authenticity

SuSE Linux RPM packages have a GnuPG signature:



1024D/9C800ACA 2000-10-19 SuSE Package Signing Key <build@suse.de>
Key fingerprint = 79C1 79B2 E1C8 20C1 890F  9994 A84E DAE8 9C80 0ACA
  

The command


rpm -checksig apache-1.3.12.rpm

can be used to verify the signature of an RPM package to determine whether it really originates from SuSE or from another trustworthy facility. This is especially recommended for update packages from the Internet. Our public package signature key normally resides in /root/.gnupg/. Since version 8.1, the key is additionally located in the directory /usr/lib/rpm/gnupg/ to enable normal users to verify the signature of RPM packages.


Managing Packages: Install, Update, and Uninstall

Normally, the installation of an RPM archive is quite simple:


rpm -i <package>.rpm

With this command, the package will be installed -- but only if its dependencies are fulfilled and there are no conflicts with other packages. With an error message, rpm requests those packages that need to be installed to meet dependency requirements. In the background, the RPM database ensures that no conflicts arise -- a specific file can only belong to one package. By choosing different options, you can force rpm to ignore these defaults, but this is only for experts. Otherwise, risk compromising the integrity of the system and possibly jeopardize the ability to update the system.

The options -U or -upgrade and -F or -freshen can be used to update a package.


rpm -F <package>.rpm

This option will remove the files of the old version and immediately install the new files. The difference between the two versions is that -U installs packages that previously did not exist in the system, but -F merely updates previously installed packages. When updating, rpm updates configuration files carefully using the following strategy:

  • If a configuration file was not changed by the system administrator, rpm will install the new version of the appropriate file. No action by the system administrator is required.
  • If a configuration file was changed by the system administrator before the update, rpm will save the changed file with the extension .rpmorig or .rpmsave (backup file) and install the version from the new package, but only when the originally installed file and the newer version are different. If this is the case, compare the backup file (.rpmorig or .rpmsave) with the newly installed file and make your changes again in the new file. Afterwards, be sure to delete all .rpmorig and .rpmsave files to avoid problems with future updates.
  • .rpmnew files appear if the configuration file already exists and if the noreplace label was specified in the .spec file.

Following an update, .rpmsave and .rpmnew files should be removed after comparing them, so they do not obstruct future updates. The .rpmorig extension is assigned if the file has not previously been recognized by the RPM database.

Otherwise, .rpmsave is used. In other words, .rpmorig results from updating from a foreign format to RPM. .rpmsave results from updating from an older RPM to a newer RPM. .rpmnew does not disclose any information as to whether the system administrator has made any changes to the configuration file. A list of these files is available in /var/adm/rpmconfigcheck. Some configuration files (like /etc/httpd/httpd.conf) purposely are not overwritten to enable a seamless takeover of the running operations using the personal settings.

The -U switch is not just an equivalent to uninstalling with the (-e) option and installing with the (-i) option. Use -U whenever possible.

To remove a package, enter the following command:


rpm -e <paket>

rpm will only delete the package if there are no unresolved dependencies. It is theoretically impossible to delete Tcl/Tk, for example, as long as another application requires it. Even in this case, RPM calls for assistance from the database. If such a deletion is -- for whatever reason and under unusual circumstances -- impossible, even if no additional dependencies exist, it may be helpful to rebuild the RPM database using the option -rebuilddb. See 2 for more information about the RPM database.


RPM and Patches

To guarantee the operational security of a system, update packages must be installed in the system from time to time. Previously, a bug in a package could only be eliminated by replacing the entire package. Large packages with small bugs could easily result in large amounts of data. However, since SuSE 8.1, the SuSE RPM offers a new feature enabling the installation of patches in packages.

The most important considerations are demonstrated using pine as an example:

  • Is the patch RPM suitable for my system?

    To check this, first query the installed version of the package. For pine, this can be done with the following command:


    rpm -q pine

     pine-4.44-188

    Then check if the patch RPM is suitable for this version of pine:


    rpm -qp -basedon pine-4.44-224.i586.patch.rpm

    pine = 4.44-188

    pine = 4.44-195

    pine = 4.44-207

    This patch is suitable for three different versions of pine. The installed version in our example is also listed, so the patch can be installed.

  • Which files are replaced by the patch?

    The files affected by a patch can easily be seen in the patch RPM. The rpm parameter -P serves the selection of special patch features. The list of files is displayed with the following command:


    rpm -qpPl pine-4.44-224.i586.patch.rpm

    /etc/pine.conf

    /etc/pine.conf.fixed

    /usr/bin/pine

    or, if the patch is already installed, with the following command:


    rpm -qPl pine

    /etc/pine.conf

    /etc/pine.conf.fixed

    /usr/bin/pine

  • How can a patch RPM be installed in the system?

    Patch RPMs are used just like normal RPMs. The only difference is that a suitable RPM must already be installed.

  • Which patches are already installed in the system, and for which package versions?

    A list of all patches installed in the system can be displayed with the command rpm -qPa. If only one patch is installed in a new system (like in our example), the list appear as follows:


    rpm -qPa

    pine-4.44-224

    If, at a later date, you want to know which package version was originally installed, this information is also available in the RPM database. For pine, this information can be displayed with the following command:


    rpm -q -basedon pine

    pine = 4.44-188

More information, including information on the patch feature of RPM, is available in [1]rpm and in [1]rpmbuild.


RPM Queries

With the -q option, rpm initiates queries, making it possible to inspect an RPM archive (by adding the option -p) and also to query the RPM database of installed packages. Several switches are available to specify the type of information required (see Table 2.1).

The Most Important RPM Query Options (-q [-p] ...<package>)
-i Package information
-l File list
-f <FILE> Query a package owned by <FILE> (the full path must be specified with <FILE>)
-s File list with status information (implies -l)
-d List only documentation files (implies -l)
-c List only configuration files (implies -l)
-dump File list with complete details (to be used with -l, -c, or -d)
-provides List features of the package that another package can request with -requires
-requires, -R Capabilities the package requires
-scripts Installation scripts (preinstall, postinstall, uninstall)

For example, the command rpm -q -i wget displays the information shown in Output 3.

aus:update.rpm-i

rpm -q -i wget
Name : wget Relocations: (not relocateable)
Version : 1.8.1 Vendor: SuSE AG, Nuernberg, Germany
Release : 142 Build Date: Fri Apr 5 16:08:13 2002
Install date: Mon Apr 8 13:54:08 2002 Build Host: knox.suse.de
Group : Productivity/Networking/Web/Utilities Source RPM: wget-1.8.1-142.src.rpm
Size : 2166418 License: GPL
Packager : http://www.suse.de/feedback
Summary : A tool for mirroring FTP and HTTP servers
Description :
Wget enables you to retrieve WWW documents or FTP files from a server.
This might be done in script files or via command line.
[...]

Option -f only works if you specify the complete file name with its full path. You can name as many file names as you want. For example, rpm -q -f /bin/rpm /usr/bin/wget results in:

rpm-3.0.3-3
wget-1.5.3-55

If only part of the file name is known, a shell script must be implemented, shown in File 1. Pass the partial file name to the script shown as a parameter when running it.

File: rpm.verify

Script to Search for Packages

#! /bin/sh
for i in $(rpm -q -a -l | grep  $1); do
    echo "\"$i\" is in package:"
    rpm -q -f $i
    echo ""
done

The command rpm -q -changelog rpm displays a detailed list of information (updates, configuration, modifications, etc.) about a specific package.This example shows information on the package rpm. However, only the last five change entries in the RPM database are listed. All entries (dating back the last two years) are included in the package itself. This query only works if CD 1 is mounted at /cdrom:


rpm -qp -changelog /cdrom/suse/i586/rpm-3*.rpm

With the help of the installed RPM database, verification checks can be made. These checks are initiated with the option -V, -y, or -verify. With this option, rpm will show all files in a package that have been changed since installation. rpm uses eight character symbols to give some hints about the following changes:

RPM Verify Options
5 MD5 check sum
S File size
L Symbolic link
T Modification time
D Major and minor device numbers
U Owner
G Group
M Mode (permissions and file type)

In the case of configuration files, the letter c will be printed. Example for changes to /etc/wgetrc (package wget):


rpm -V wget

S.5....T c /etc/wgetrc

The files of the RPM database are placed in /var/lib/rpm. If the partition /usr has a size of 1 GB, this database can occupy nearly 30 MB, especially after a complete update. If the database is much larger than expected, it is useful to rebuild the database with the option -rebuilddb. Before doing this, make a backup of the old database. The cron script cron.daily makes daily copies of the database (packed with gzip) and stores them in /var/adm/backup/rpmdb. The number of copies is controlled by the variable <MAX_RPMDB_BACKUPS> (default: 5) in /etc/sysconfig/backup. The size of a single backup is approximately 3 MB for 1 GB in /usr.


Installing and Compiling Source Packages

All source packages of SuSE Linux carry an .src.rpm extension (source RPM).


Tip

These packages can be handled in the same way as all other packages. The packages, however, will not be found in the RPM database (and are not marked with an [i] in YaST), as only ``installed'' software is listed. This is because the source packages are not incorporated in the RPM database. Only installed operating system software is listed in the RPM database.

The following directories must be available for rpm and rpmbuild in /usr/src/packages (unless you specified custom settings in a file such as /etc/rpmrc):

SOURCES
this is for the original sources (.tar.gz files, etc.) and for distribution-specific adjustments (.dif files).
SPECS
for the ``.spec'' files, similar to a meta Makefile, which control the ``build'' process.
BUILD
All the sources are unpacked, patched, and compiled in this directory.
RPMS
This is where the completed ``binary'' packages are stored.
SRPMS
here are the ``source'' RPMs.

When you install a source package with YaST, all the necessary components will be installed in /usr/src/packages: the sources and the adjustments in SOURCES and the relevant .spec file in SPECS.


Note

Do not experiment with system components ( package glibc, package rpm, package sysvinit, etc.), as this endangers the operability of your system.

The following example uses the wget.src.rpm package. After you have installed the package with YaST, you should have the following files:


/usr/src/packages/SPECS/wget.spec
/usr/src/packages/SOURCES/wget-1.4.5.dif
/usr/src/packages/SOURCES/wget-1.4.5.tar.gz

rpmbuild -b <X> /usr/src/packages/SPECS/wget.spec starts the compilation. <X> is a wild card for various stages of the build process (see the output of -help or the RPM documentation for details). The following is merely a brief explanation:

-bp
Prepare sources in /usr/src/packages/BUILD: unpack and patch.
-bc
the same as -bp, but with additional compilation.
-bi
the same as -bp, but with additional installation of the built software. Caution: if the package does not support the BuildRoot feature, you might overwrite configuration files.
-bb
the same as -bi, but with the additional creation of the ``binary'' package. If the compile was successful, the binary should be in /usr/src/packages/RPMS.
-ba
the same as -bb, but with the additional creation of the ``source RPM''. If the compilation was successful, the binary should be in /usr/src/packages/SRPMS.

-short-circuit lets you skip specific steps. This binary RPM can now be installed with rpm -i or, preferably, with rpm -U. Installation with rpm makes it appear in the RPM database.


Compiling RPM Packages with build

The danger with many packages is that during the build process, unwanted files are added to the running system. To prevent this, use the package build, which creates a defined environment in which the package is built. To establish this ``chroot'' environment, the build script must be provided with a complete package tree. This tree can be made available on the hard disk, via NFS, or from DVD. The respective position is specified with build -rpms <path>. In contrast to rpm, the build command looks for the SPEC file in the source directory. To build wget anew (like in the above example) and the DVD is mounted in the system under /media/dvd, use the following commands as SuSE @nohyphen root:


cd /usr/src/packages/SOURCES/

mv ../SPECS/wget.spec .

build -rpms /media/dvd/suse/ wget.spec

Subsequently, a minimum environment will be established at /var/tmp/build-root. The package will be built in this environment. Upon completion, the resulting packages are located in /var/tmp/build-root/usr/src/packages/RPMS

The build script offers a number of additional options. For example, you can cause the script to prefer your own RPMs, omit the initialization of the build environment, or limit the rpm command to one of the above-mentioned stages. Additional information can be accessed with the command build -help and in [1]build.


Tools for RPM Archives and the RPM Database

[mc]Midnight Commander can display the contents of RPM archives and copy parts of them. It represents archives as virtual file systems, offering all usual menu options of Midnight Commander: the HEADER information can be displayed with F3, the archive structure can be viewed with the cursor keys and , and archive components can be copied with F5. A front-end for rpm is also available for Emacs.

KDE offers the kpackage tool. GNOME offers gnorpm.

Using the [alien]Alien Perl script, it is possible to convert or install an ``alien'' binary package. This tries to convert ``old'' TGZ archives to RPM before installing. This way, the RPM database can keep track of such a package after it has been installed. Beware: alien is still ``alpha'' software, according to its author -- even if it already has a high version number.


next up previous contents index
Next: Configuration Up: Installation Previous: The Installation   Contents   Index
root 2003-11-05