Chapter 8. Installing Software Using the RPM Package Manager
This chapter explains the Red Hat Package Manager (RPM), a tool that facilitates installing, uninstalling, and upgrading software for your Red Hat Linux system. The chapter explains how to use RPM to find the package associated with an application and how to quickly and easily install the package. It also explains how to use RPM to upgrade packages and query the status of installed packages.
An RPM package (or more simply, an RPM or a package) is a file that contains executable programs, scripts, documentation, and other files needed by an application or software unit. RPM packages are generally named using a convention that lets you determine the name of the package, the version of the software, the release number of the software, and the system architecture for which the application is intended. Figure 8-1 shows how the components of a package name are arranged.
Figure 8-1. The structure of a package name
8.1 The Package Management Tool
Red Hat Enterprise Linux and Fedora Core feature a package management tool that's much easier to use than GnoRPM, the tool included in previous versions of Red Hat Linux. To launch the package management tool, choose System Settings images/ent/U2192.GIF border=0> Add/Remove Applications from the main menu. Only the root user can manipulate packages. If you're not logged in as the root user, the tool helpfully prompts you for the root user's password. The tool checks the status of installed packages, as shown in Figure 8-2. This process may require a minute or two. Then, the Add or Remove Packages window (Figure 8-3) appears.
Figure 8-2. Checking system package status
Figure 8-3. The Add or Remove Packages window
8.1.1 Installing Package Groups and Packages
To install a package package group, select the checkbox next to the name of an uninstalled package group. In Figure 8-3, the Editors package group is not installed, as indicated by the unchecked checkbox to the left of the package group's name. By enabling the checkbox, you can specify that you want to install the package group. Installation does not begin until you click the Update button.
Most package groups contain optional packages that you can install or omit, according to your preference. The numbers to the right of the package group name indicate how many of the optional packages are installed. If you've just specified that a package group should be installed, the numbers indicate how many of the optional packages will be installed when you click the Update button. For example, in Figure 8-3, the 0/4 associated with the Editors package group indicates that none of the four associated packages is currently installed. If you enable the checkbox associated with the Editors package group, the numbers immediately change to 3/4, meaning that three of the four associated packages will be installed when you click the Update button.
To learn more about the optional packages associated with a package group, click the Details link. The Package Details window appears, as shown in Figure 8-4. This window provides checkboxes that you can use to specify which optional packages you want installed. If you can't see the list of package names, expand the tree by clicking the triangle next to the text Extra Packages. When you're done viewing the package details, close the window by clicking Close. You can then install the selected packages by clicking Update. The package management tool will prompt you to insert the appropriate installation CD, in necessary. To close the Add or Remove Packages window without installing or removing any packages, click the Quit button.
Figure 8-4. The Editors Package Details window
8.1.2 Removing Package Groups and Packages
You can also delete package groups and packages by using the package management tool. To remove a package group, disable the checkbox associated with the package group. To remove a package, open the Package Details window and disable the checkbox associated with the package. No changes are made until you click the Update button of the Add or Remove Packages window.
8.1.3 Installing Packages from the Hard Disk
If you have several free gigabytes of disk storage, you may prefer to copy the Red Hat Linux installation media to your hard disk. Doing so avoids the need to insert CDs when installing packages.
To set up your system for installing packages from the hard disk, open a terminal window, become the root user, and issue the following command to create the directory /var/redhat-tree/RedHat:
mkdir -p /var/redhat-tree/RedHat
The -p flag enables you to create the directory and its parent directory in a single command. Without the flag, the command will fail because the /var/redhat-tree directory does not exist.
Next, mount installation CD 1 and copy the contents of the RedHat directory (/mnt/cdrom/RedHat) to the new directory:
cp -a /mnt/cdrom/RedHat/* /var/redhat-tree/RedHat
Finally, copy the files from installation CD 2, CD 3, and CD 4 to the same location.
To install packages, launch the package management tool by issuing the command:
The tool will no longer prompt you to insert a CD; instead, it will obtain package files from the /redhat-tree directory. To avoid typing this command to install packages, you can create a panel launcher or menu item, as explained in Chapter 5 and Chapter 6.