Part VI SuSE Linux: Updating and Special Features 357 Chapter 15 Updating the System and Package Management 15.1 Updating SuSE Linux SuSE Linux offers you the option of updating an existing system without having to reinstall everything. But it is important to distinguish between updating one, or a few packages, and updating the entire system to the latest distribution. It is quite normal for software to "grow". Thus we recommend you to have a look at how full the partitions are, with df, before updating! If you think there might be too little space available, you should consider making a backup and repartitioning. There is no rule of thumb as to how much space you need in particular cases. This depends on the existing partitions, the software selected and which version you want to update SuSE Linux 6.4 from. 15.1.1 Preparations Before you begin an update, make sure you have saved the old configuration files to a separate medium such as a streamer, removable drives, floppies or ZIP drives, just in case things go wrong. Normally these are the files in /etc and /var/lib (e. g. for News or xdm). In addition, no harm would be done if you wrote the current user data in /home (the "home directories") to a backup medium. Before you start the update process, remember to write down the device name of your root partition. In this case, /dev/sda3 would be your root partition. You can see this with the command: earth: # df / Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sda3 4167999 3253471 698856 82% / /dev/sda1 7496 1311 5785 18% /boot This shows that /dev/sda3 is mounted in the filesystem in /. 359 15. Updating the System and Package Management Before updating PostgreSQL (package postgres) we recommend that you make a dump of the databases (see manpage for pg dump (man pg dump)). This is only needed, however, if you used PostgreSQL previously. Now you still need to decide if you want to update using the text-oriented YaST or with the graphical YaST2. The decision is made for you if you want to update from a SuSE Linux before version 6.0 ­ in this case you should use YaST and proceed as described in Section 15.1.3. From version 6.0 onwards you can update using YaST2. 15.1.2 Updating with YaST2 After the preparations mentioned in Section 15.1.1 on the preceding page, you should first boot as described in the installation chapter 2.1 page 13. You can only carry out an update with YaST2 if you want to update a SuSE Linux 6.x. For older versions (e. g.SuSE Linux 5.3) YaST1 is the right method; see Section sec:update.basissystem. If you have reached Section 2.1.7 page 17, choose the option `Update'. 15.1.3 Updating with YaST1 Updating the Base System Because central components of the system (such as libraries) must be replaced when updating the base system, this task cannot be performed during normal operations, i.e. from the currently running Linux system. It is helpful to read the file README or in DOS/Windows README.DOS on the CD; here additional changes are noted which may have been made after the handbook has been printed! You need to start the update environment ­ normally using either the supplied "boot disk" or by entering manually at the kernel boot prompt, as described in detail in Section 2.2.1 page 24 (Note: from 6.3, CD 2 should be used!). Essentially the following steps are necessary: 1. As soon as the kernel has booted, linuxrc is started automatically. 2. In the main menu of linuxrc, in the menu `Settings', you need to choose the language, monitor and keyboard and press `OK' when you are finished. 3. Now make sure that you load all the drivers you need by selecting `Ker- nel modules'. The exact procedure is given in the linuxrc description in Section 83 page 383. 4. After this has been done, selecting `Installation / Startup system' and `Startup installation' leads you to the selec- tion of your source medium (see Section 83 page 385). 360 15.1. Updating SuSE Linux 5. linuxrc then loads the installation environment and starts YaST automat- ically. In YaST's main menu you should select `Update existing system'. YaST then tries to determine the root partition and displays the result. Here you can now select your root partition, as mentioned above (for example: /dev/sda3 ). YaST then reads the existing "old" /etc/fstab and mounts the partitions it found in this file. Now select `Continue'. After returning to the main menu by pressing Esc , choose `Updating your system' (Section 3.2 page 71). Your old system is now analysed by YaST and the results are displayed in a list. After this, all the central configuration files of the system are updated. YaST creates backup files of those files that have changed since the last installation. When the base system has been updated, you will find yourself in YaST's special update mode, where you can decide on which packages to update. In addition, old configuration files will be saved as .rpmorig or .rpmsave (see Section 15.3.1 page 370). This procedure is recorded in /var/adm/ inst-log/installation-*, and may be consulted later on. Updating the Rest of the System If you use loadlin for booting you will need to copy the new kernel and possibly your initrd as well to the loadlin directory on your DOS partition! When the base system has been updated you will then be placed in YaST's special update mode. Here you may update the rest of your system as you please. YaST then builds two lists. The first list shows those packages YaST has recognized, and where it has decided that an update could be useful. The second list shows you those packages where this is not so straightforward (perhaps the old package still works, but provides no information about its version). Using these two lists, you can decide which packages should be updated. When you begin the update, all packages selected will be replaced by the new ones-whereby all files will be saved that have been changed since the last installation. After completing this task, you should proceed as with a first-time installa- tion. One of the things you will need to do is select a new kernel. If you use loadlin for booting you obviously need to copy the new kernel and possibly your initrd as well to the loadlin directory on your DOS partition! If you do not want the system to be rebooted in its normal runlevel (see standard runlevel Section 17.2 page 396), but would like YaST to complete the installation, you should enter the following at the LILO prompt: 361 15. Updating the System and Package Management NO AUTO SETUP=true This parameter is especially useful if you encounter problems when booting again. These might occur, if you access important parts of your system, for example via PCMCIA-SCSI. To continue with the prepared configuration, the following steps could be taken: 1. Enter the following parameter at the LILO prompt: NO_AUTO_SETUP=true 2. Change to user `root' and start YaST with: yast --nomenu to complete its configuration tasks. 3. Start /lib/YaST/bootsetup.conf as `root'. Experienced Linux users might not want to start in the default runlevel, but in the "single user mode". This can be achieved by entering single at the LILO prompt. 15.1.4 Updating Single Packages With SuSE Linux, you can update single packages whenever you want. In YaST's package list (see Section 3.4.3 page 84), you can move around as you please. If you select a package which is needed for the system to run, you will be warned by YaST. Such packages should be replaced only in update mode. For example, many packages contain shared libraries which could be in use when you want to run an update. Updating shared libraries on a running system will inevitably cause problems. 15.2 From Version to Version In the following sections we will list details of things which have been changed from one version to the next. In this overview such things as config- uration file syntax changes and abnormal behavior of well-known programs are listed. But only those anomalies are listed which might cause problems for the administrator or user. This list is probably incomplete. Please also consult the Support DataBase- which can be found in the package sdb, series doc (cf. Section 1.4.1 page 5). Known problems and other abnormal features of each version will be an- nounced when they become known on the web server, at: http://sdb.suse.de/sdb/en/html 15.2.1 From 4.x to 5.0 Problems and special issues: see http://sdb.suse.de/sdb/en/html/maddin_bugs5.html. * Package management has been changed from TGZ to RPM (cf. Sec- tion 15.3 page 370). * New Bash. ­ see SDB: http://sdb.suse.de/sdb/en/html/maddin_bash2.html 362 15.2. From Version to Version * startx is no longer started in the background ­ see SDB: http://sdb.suse.de/sdb/en/html/maddin_xprompt5. html * To start Samba, set the variable START_SMB=yes in /etc/rc. config. * System-relevant cron jobs are now listed in /etc/crontab (see Section 16.6.1 page 392). * All users in the new group `dialout' who are allowed to execute "dialout" programs (minicom, pppd, etc.) have been placed in the new group `dialout'. * The filesystem of the rescue system is now modelled on the layout of the running system. * Functionality of /etc/securetty is now handled by /etc/login. defs. 15.2.2 From 5.0 to 5.1 Problems and special issues: see http://sdb.suse.de/sdb/en/html/maddin_bugs51.html. * LILO , case 1: The loaders any_b.b and any_d.b are now obsolete (see Section 12 page 111). * LILO , case 2: In case of trouble when booting with SCSI host adapter Adaptec 2940 (different types) you should no longer set the option linear in /etc/lilo.conf (see Section 4.4.2 page 111) . * "optional" software (e. g. KDE or Applixware ) is now installed in /opt (see Section 2.8 page 59). * For reasons of space, the package descriptions are no longer part of the book, but are to be found on the first CD in /docu. The German files are: pkg_German.dvi and pkg_German.ps, the English files are: pkg_English.dvi and pkg_English.ps. * The "Hardware chapter" no longer exists. Instead there is now the "CDB" (Component DataBase: package cdb, series doc, or online at http://www.suse.de/cdb/deutsch/ or http://www.suse.de/cdb/english/ ). * sendmail's m4 files are located in /usr/share/sendmail. * The sources have been packed as so-called "Source RPMS" ­ cf. in the SDB: http://sdb.suse.de/sdb/en/html/ke_source-rpm.html). 15.2.3 From 5.1 to 5.2 Problems and special issues: see http://sdb.suse.de/sdb/en/html/maddin_bugs52.html. * YaST : the series ALL may be selected from `Series selection' with F4 (= `Sort') (see Section 3.4.3 page 84). 363 15. Updating the System and Package Management * The XSuSE servers are now part of the official XFree86 sources. Please use the standard servers from series x. Exception: XSuSE_Elsa_ GLoria (package xglint), for Glint or Permedia based graphics de- vices. * Due to security reasons the X servers are no longer set to suid root (that is, without the `s' bit). You need to start the X Window System via the Xwrapper (via startx), or by using a display manager (xdm or kdm). * wuftpd has now been made the default FTP server in /etc/inetd. conf ­ see SDB: http://sdb.suse.de/sdb/en/html/grimmer_ftpd.html) * The options for ps are no longer preceeded by a `-'. Please adapt your shell scripts accordingly ­ see SDB: http://sdb.suse.de/sdb/en/html/maddin_ps52.html). * SuSEconfig (see Section 17.6 page 400) now understands some options which can speed up your work. 15.2.4 From 5.2 to 5.3 Problems and special issues: see http://sdb.suse.de/sdb/en/html/bugs53.html. * The initial installation of SuSE Linux or of an update is now more straightforward ("linear"). For those who want to use the "old" method, please select YaST's `Expert mode' (see Figure 2.6 page 29). * Besides the boot disk there is an optional modules disk containing ad- ditional modules. This is only needed for "exotic" hardware (see Sec- tion 16.3 page 382.) * The X servers are now stored in series xsrv (X-Server), and no longer in series x. * X servers for "brand new graphics devices" (XFCom_3DLabs (pack- age x3dlabs; former XSuSE_Elsa_GLoria, package xglint), XFCom_SiS (package xsis; former XSuSE_SiS) and XFCom_ Cyrix (package xcyrix) have now been developed by SuSE. * Users who want to access terminal programs such as minicom or seyon need to be added to the group `uucp' ­ see http://sdb.suse.de/sdb/en/html/ke_terminal-prog. html. * Emacs comes as version 20.x. The adapted startup files in /etc/skel should be used ­ see SDB: http://sdb.suse.de/sdb/en/html/ke_emacs-update. html. * The SGML parser tools from package jade dsl are now in their own package, package sp. * PostgreSQL (package postgres) consists of a number of sub- packages: database engine, database initialization and interfaces. * Man pages have been moved from package allman to different sub- packages ­ see SDB: http://sdb.suse.de/sdb/en/html/ke_lpdmanxx.html. 364 15.2. From Version to Version 15.2.5 From 5.3 to 6.0 Problems and special issues: see http://sdb.suse.de/sdb/en/html/bugs60.html. * As provided for by the kernel sources, the boot kernel will now be in- stalled to /boot. If you do an update make sure the paths in /etc/ lilo.conf are set correctly when YaST prompts you for the change. If you still want to use the old kernel in /vmlinux you need to interrupt the process and set up LILO accordingly. * The system libraries have changed to glibc (also known as libc6). Up- dating program packages from SuSE Linux should not cause any trouble. You should recompile your own programs after the update and link them against glibc. If this is not possible (e. g.you do not have the sources) the solution is to install the package shlibs5 (libc5). Now "older" programs should run. * SuSE Linux comes with the latest teTeX version. As the teTeX version is installed in accordance with the Filesystem Hierarchy Standard (FHS) it needs additional space (approx. 15 MB) in the directory /var. teTeX has been split up into several sub-packages, so if something is missing after an update, you may need to check in the series tex to make sure that everything really has been installed properly. * The LATEX extensions package colortbl and package hyperref are now part of teTeX. * The DocBook style sheets are now located in package docbkdsl (series sgm). 15.2.6 From 6.0 to 6.1 Problems and special issues: see http://sdb.suse.de/sdb/en/html/bugs61.html. * The CD containing the "Live-Filesystem" is no longer included. This CD may be purchased separately. Technical details of this CD may be found in Section 3.6.4 page 96. * Additional drivers that might be necessary for an installation or an update (proprietary CD-ROM drives, drives on the parallel port, PCMCIA) are located on the modules disk image (Section 2.2.3 page 25). * The default interface for printing on the parallel port is /env/lp0 for kernel 2.2.x, see Section 12.1 page 293. In the following sections we will list details of things which have been changed from one version to the next. In this overview such things as config- uration file syntax changes and abnormal behavior of well-known programs are listed. But only those anomalies are listed which might cause problems for the administrator or user. This list is probably incomplete. Please also consult the Support DataBase- which can be found in the package sdb, series doc (cf. Section 1.4.1 page 5). Known problems and other abnormal features will be announced at: http://sdb.suse.de/sdb/en/html 365 15. Updating the System and Package Management 15.2.7 From 6.1 to 6.2 Problems and special issues: http://sdb.suse.de/sdb/en/html/bugs62.html. * rpm (see also Section 15.3 page 370) is now available as version 3.0. The format of the RPM database has changed; the database must be converted the moment rpm is installed. For a regular update of the (base) system using YaST this conversion is taken care of automatically. * The glibc system libraries are now available in version 2.1. As far as possible, components are provided which continue to allow glibc-2.0 pro- grams to be run; this causes problems, however, when attempts are made to access certain symbols. Therefore any programs of your own, or exter- nal programs, should in principle be recompiled. * The nscd Name Service Cache Daemon also belongs to the glibc and is configured via the /etc/nscd.conf; refer to manpage for nscd (man 8 nscd). * With glibc-2.1, conversion to "Unix98 PTY" devices is now complete. This means that the devpts filesystem also needs to be mounted; the following entry in the file /etc/fstab, for example, guarantees this; none /dev/pts devpts gid=5,mode=620 0 0 See also the documentation in /usr/src/linux/Documentation/ Changes in the kernel sources. * PAM Pluggable Authentication Modules: In addition to /etc/login. defs there are now the files /etc/securetty, /etc/security/ limits.conf and /etc/security/pam_env.conf; see also page 100. * Language settings can be specified with variables in /etc/rc.config; see Section 88 page 401 as well as http://sdb.suse.de/sdb/en/html/ml_locale_implementation. html If you don't want to see German messages, you can write the following directly into .bashrc, for example: export LANG=C * For a number of packages, the components needed for software develop- ment (libraries, headers, include files, etc.) have been given their own packages; in part, this also occurred in earlier versions. These develop- ment packages are only needed if you want to compile software yourself ­ for example, more recent GNOME packages. These development pack- ages can be recognized from their name extensions of dev or d: package xformsd, package glibndev, package gtkndev, package imlib- dev, package gnlibsd, etc. 15.2.8 From 6.2 to 6.3 Problems and special issues: http://sdb.suse.de/sdb/en/html/bugs62.html and http://sdb.suse.de/sdb/en/html/bugs63.html 366 15.2. From Version to Version * If you want to update SuSE Linux from a previous version to 6.4 you should now use the special update-CD (Nr. 2) or the boot disks supplied, to start the "update environment" (see Section 15.1.3 page 360). * Various optimized kernels are available for installation; these kernels use an "initrd" Initial Ramdisk. When compiling your own kernel you should be aware of this; refer to Section 16.2.5 page 381 and http://sdb.suse.de/sdb/en/html/adrian_6.3_boot. html. * The configuration file for the kernel modules is /etc/modules.conf (previously: /etc/conf.modules). * Apart from the "userspace" NFS daemon (package nfsserv), the kernel-based NFS daemon (package knfsd) is also available. kn- fsd only has limited functionality, but it is able to lock files; this is needed by StarOffice, for example. You should set the variables USE KERNEL NFSD or NFS SERVER in /etc/rc.config. * The Manpages are now located in /usr/share/man, as specified in the FHS "Filesystem Hierarchy Standard"; see also the package fhs or, on the web, http://www.pathname.com/fhs/. * Some software packages which were removed from the distribution: ­ package gnuhtml: outdated; the current info documents can be viewed in HTML format via the SuSE-helpsystem (see also Sec- tion 16.4 page 386). ­ package glimpse: An older version can be found in the directory /unsorted on CD 1. For reasons of copyright we cannot include the new version in SuSE Linux. * Tcl/Tk is available in new versions with new package descriptions. Tcl/Tk 8.0 is the standard version. * OSS Open Sound System is now also available for multi-processor ma- chines; the individual packages are package opso and package op- sod up, as well as package opso smp and package opsodsmp; see http://sdb.suse.de/sdb/en/html/oss-smp.html * The settings of sendmail have been moved from /etc/rc.config to the file /etc/rc.config.d/sendmail.rc.config; see http://sdb.suse.de/sdb/en/html/mneden_6.3_sendmail. html. * for security reasons, the program WU-FTPD (package wuftpd, series n) is no longer installed by default. * For leafnode, the directory for configuration files has changed from version 1.9.2. It can now be found in /etc/leafnode instead of /usr/lib/leafnode. If you have changed your configuration file, a backup copy can be found in /usr/lib/leafnode/config.rpmsave. Please enter your customizations by hand to the new configuration file. Warning: If you are updating from a previous version (before 1.9.3), please run the shellscript /usr/doc/packages/leafnode/update. sh first: 367 15. Updating the System and Package Management earth: # cd /usr/doc/packages/leafnode earth:/usr/doc/packages/leafnode # ./update.sh \ /var/spool/news/ /etc/leafnode /var/lock/news/fetchnews.lck This causes the file groupinfo and a few others to be re-organized. groupinfo is no longer sorted in a "case-sensitive" order). If something should go wrong here, you can find the old file in /var/spool/news/ leaf.node/groupinfo.old. If the script has run successfully, you can then delete this file (.old. Note: The program /usr/sbin/fetch has, from version 1.9.3, been renamed to /usr/sbin/fetchnews. Make sure you adapt "cron- jobs" or similar scripts (e. g. /etc/ppp/ip-up) accordingly. To install leafnode, refer to Section 6.9 page 179. * MySQL now runs with the UID `mysql' and with the GID `daemon', in order to provide and guarantee more security. * Fortify is now located in /opt/fortify; it can be easily de-installed after being applied. 15.2.9 From 6.3 to 6.4 Problems and Special Features: http://sdb.suse.de/sdb/en/html/bugs64.html. * Kernel. The package kernmod or package kernmods packages are no longer necessary. The accordingly optimized kernel modules are in- stalled "in one go" together with the kernel selected (see 3.6.2 page 92). The configuration files of the installed kernel are located in /boot as vmlinuz.config-pentium (Example!), vmlinuz.autoconf. h and vmlinuz.version.h. If you want, YaST will copy these files to the tree of the kernel sources. * Valid login shells are entered in /etc/shells; see manpage for shells (man 5 shells). If a user is allocated to /bin/true, then this user can only log in via the X Window System; he cannot obtain a shell. /bin/false as a "login shell" prevents any kind of log in. * package aaa base: For reasons of clarity, the maintenance work which is needed to be carried out daily on the system has been divided into a number of scripts. In /etc/cron.daily there are now, apart from aaa_base, the components backup_rpmdb, clean_catman, clean_core, clean_instlog, clean_tmp, do_mandb, rotate_logs and updatedb; in addition aaa_base lreads cron.daily.local, where your own extensions can be en- tered. For more information on the Cron system, refer to Section 16.6.1 page 392. * A newer version of tar (tar) has been included. The overwrite behavior when unpacking existing files has been changed. If you rely on the old mode, please use the option --overwrite. * Almost all programs in the package package nkita and package nkitb are in new versions. traceroute has been moved to the package package nkitb. A number of programs are already "IPv6 ready"; for this reason you should endure that DNS is correctly configured ­ otherwise it is possible you might have to wait for the DNS timeout for IPv6 queries. 368 15.2. From Version to Version * On the package postfix: further setting options have been added; the start variables have been moved to /etc/rc.config.d/postfix. rc.config; see also Section 17.5 page 399. * The package squid, that is, version 1.x of the WWW proxy server, is no longer included. Since the now established version version 2.x is regarded as stable, it is generally recommended that you change to this. During the update the package squid is not automatically replaced by package squid2; it is at least necessary to delete the cache and check the configuration files. * The recommended DHCP client is to be found in the package package dhcpd; for special cases, the package package dhclient is included. * For reasons of security, anonymous FTP is no longer allowed automati- cally. In order to allow anonymous FTP with the ftp daemon, in.ftpd the comment sign `#' in /etc/pam.d/ftpd must be removed at the beginning of the line: auth sufficient /lib/security/pam_ftp.so * Changing the password with PAM Pluggable Authentication Modules. pam unix can also change NIS passwords and understands md5 hashes as passwords. Caution: see Section 3.6.7 page 100. There is now a new pam pwcheck module which takes over the verifi- cation of new passwords. The old entry: password required /lib/security/pam_unix.so #strict=false must be changed (in each case just one line, or with \ at the end of the line): password required /lib/security/pam_pwcheck.so \ nullok #use_cracklib password required /lib/security/pam_unix.so \ nullok use_first_pass use_authtok This manual intrusion is only necessary if rpm is not allowed to change the configuration files itself, because the system administrator has made his own changes. This is, by the way, the case for all PAM configuration files located in /etc/pam.d. * As well as the manpages (see Section 15.2.8 page 367, the info pages are now also located in /usr/share. * makewhatis (package makewhat) now uses the help program manpath to locate the manpages. The environment variable MANPATH should no longer be set in rc files. * The package ncurses packages is a new version, 5.0; version 4.2 of the "shared library" is still included, so that as a rule pre-compiled programs can be still be used. * The package apache package has been split up. If you need special enhancements, you should also install the mod * subpackages. Docu- mentation on PHP can be found in the package package phpdoc. For organisational reasons the log files can be found in /var/log/httpd. 369 15. Updating the System and Package Management * Roxen is split up in the following way: The package roxen package without encryption and the package roxenssl is an addition with en- cryption support. This has the advantage that a separate package, package roxenint no longer has to be managed. * The package changes package was discontinued. The same information can be given by rpm: newbie@earth: > rpm -q --changelog 15.3 RPM-the Package Manager RPM (rpm), the "Red Hat Package Manager", was introduced in SuSE Linux 5.0. The RPM database provides detailed information about the soft- ware packages installed, making life easier for everyone: users, system ad- ministrators and package builders. rpm does the following: * compiles software applications from so-called "pristine" sources and packages them for installation * installs, upgrades and cleanly uninstalls software packaged in the RPM format * supports queries, including dependencies, about packages and maintains the RPM database of installed packages The reader is referred to the manpage for rpm (man rpm) and the book Maximum RPM, Bailey, 1997, Red Hat, for more information on building RPM packages. The other capabilities of RPM are briefly described below. Installable RPM archives are packed in a special binary format. These archives consist of the program files to be installed, as well as certain meta- information which is 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. 15.3.1 Managing Packages: Install, Update and Uninstall Normally, installing an RPM archive is as easy as this: earth: # rpm -i .rpm With this command, the package will be installed ­ but only if its dependency requirements are met and if it does not conflict with another package. With an error message, rpm requests those packages it needs to be installed to fulfill dependencies. In the background the RPM database ensures that no conflicts will arise ­ a specific file can only belong to one package. By choosing different options you can force rpm to ignore these defaults, but make sure you know what you are doing, otherwise you risk compromising the integrity of the system, and you might jeopardize the ability to update the system. Use -U or --upgrade to update a package. This option will remove the files of the old version and immediately install the new files. rpm updates configuration files more cautiously: 370 15.3. RPM-the Package Manager * If a configuration file has not been 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 differ- ent. If this is the case, you should 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. 1 The -U switch is not just an equivalent to uninstalling with the (-e) option and installing with the (-i) option. Use -U whenever possible. After every update, you should check all backup files created by rpm. These are your old configuration files. If necessary, take over your cus- tomizations from the backup files for the new configuration files. After this process the files with the extensions .rpmorig and .rpmsave should be deleted. To remove a package, enter the command: earth: # rpm -e rpm will only delete the package if there are no unresolved dependencies. Theoretically it isn't possible to uninstall an old libc using rpm as long as another program still needs it to work properly-the RPM database guards against this. 15.3.2 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 15.1 on the following page). -i Package information -l File list -f Query a package owned by (the full path must be specified with ) -s File list with status information (implies -l) -d list only documentation files (implies -l) -c list only configuration files (implies -l) Table 15.1: continued overleaf. . . ... 1 rpm will choose .rpmorig if the file was unknown to the RPM database until now ­ other- wise .rpmsave. In other words, .rpmorig files will be created while updating from a foreign format to RPM, and .rpmsave while updating one RPM package with another RPM package. 371 15. Updating the System and Package Management --dump File list with complete details (to be used with -l, -c or -d) --provides Capabilities the package provides --requires, -R Capabilities the package requires --scripts (Un-)installation scripts (pre/post install/uninstall) Table 15.1: The most important RPM query options (-q [-p] . . . ) For example, the command earth: # rpm -q -i rpm will display something like the following information: Name : rpm Relocations: (not relocateable) Version : 3.0.3 Vendor: SuSE GmbH, Germany Release : 3 Build Date: Mit 21 Jul 1999 13:48:52 Install date: Mit 21 Jul 1999 18:44:33 MEST Build Host: euler.suse.de Group : unsorted Source RPM: rpm-3.0.3-3.src.rpm Size : 5108780 License: GPL Packager : feedback@suse.de Summary : RPM Package Manager Description : RPM Package Manager is the main tool for managing software packages of the SuSE Linux distribution. rpm can be used to install and remove software packages; with rpm it's easy to update packages. rpm keep track of all these manipulations in a central database. This way it is possible to get an overview of all installed packages; rpm also supports database queries. Option -f only works if you specify the complete filename with its full path. You can name as many filenames as you want: for example, rpm -q -f /bin/rpm /usr/bin/wget will lead to the following result: rpm-3.0.3-3 wget-1.5.3-55 % rpm-2.4.1-1 % wget-1.4.5-2 If you know only a part of the filename, you will have to use a shell script such as the following: #! /bin/sh for i in `rpm -q -a -l | grep $1 `; do echo you'll find $i in package: rpm -q -f $i echo "" done File contents 15.3.1: Script to search for packages 372 15.3. RPM-the Package Manager With the help of the RPM database, verification checks can be made. These checks are initiated with the option -V (or -y, or --verify). With this option, rpm will show all files in a package which have been changed since first being installed. rpm uses eight character symbols to give some hints about the kind of change (see Table 15.2): 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) Table 15.2: RPM verify options In the case of configuration files, the letter c will be printed. For example, if you have changed /etc/wgetrc from the package wget, you may see: earth: # 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 500 MB, this database can occupy nearly 20 MB, espe- cially after a complete update. If the database is much bigger than expected, it is useful to rebuild the database with the option --rebuilddb. Before rebuilding, make a backup copy 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 (the default is 5) in /etc/rc.config. The size of a single backup is approx- imately 2 MB. (This value is valid for a 500 MB /usr partition.) You must take this space requirement into account when deciding how large you want the root partition to be. If /var has its own partition, you don't have to worry about this. 15.3.3 Installing and Compiling Source Packages All source packages of SuSE Linux are located in the series zq (Source packages) and carry an .spm extension ("Source RPMS"). These packages can be handled in just 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. 373 15. Updating the System and Package Management The directories of rpm in /usr/src/packages must exist (if none of your own settings have been made, for example in /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 In this directory all the sources are unpacked, patched and compiled. RPMS This is where the completed "binary" packages are stored. Please don't experiment with essential system packages such as package libc, package rpm, or package nkit, etc.! This could lead to a mal- functioning system! When you install a source package from series zq with YaST , all the nec- essary components will be installed in /usr/src/packages: the sources and the adjustments in SOURCES, and the relevant .spec file in SPECS 2. For our example we will choose the wget.spm 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 rpm -b /usr/src/packages/SPECS/wget.spec starts the compilation. Here is a wildcard for different stages of the build process (see the output of the rpm --help or the RPM documentation). We will show a few options here. -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" pack- age. 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 may now be installed by invoking rpm -i or even better, with rpm -U (to make it appear in the RPM database). 2 For "making packages" see [Bai97]. Further information can be obtained from the manpage for rpm (man rpm) 374 15.3. RPM-the Package Manager 15.3.4 Other Tools for Working with RPM Archives The Midnight Commander (mc) is able to "browse" RPM archives and to operate on parts of them. This tool works on an RPM package archive as if the archive were a regular filesystem. Using mc, you can view HEADER information with F3 and you can copy parts of an archive with F5 . xrpm is a new graphical RPM manager, written in Python, which supports commands to FTP-accessed archives. KDE can use the tool krpm, a graphical interface in the X Window System, for RPM management. krpm is currently in an early development stage. 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 pack- age after it has been installed. But beware: alien is still "alpha" software, according to its author. Last but not least, there is YaST . . . 375 15. Updating the System and Package Management 376