Installing Rpms

The basic syntax for installing an RPM is

package is the complete name of the RPM to install and options refines the installation process. Table 23-3 lists commonly used options values. See the rpm man page for a comprehensive listing.

Table 23-3 COMMON RPM INSTALLATION OPTIONS

Option Description

--force Install the package even if it is already installed, install an older package version, or replace files already installed.

--h Print up to 50 hash marks (#) to illustrate the progress of the installation.

--nodeps Do not perform a dependency check before installing or upgrading a package.

--test Do not install the package or update the database, just identify and display possible conflicts or dependency errors.

-v Be slightly verbose and show some useful information during the installation.

Although they appear similar, - -force and - -nodeps serve different purposes. --nodeps only disables dependency checks. Use it only if you are certain that a dependency conflict will not cause problems later on. --force forces package installation regardless of all potential problems except for dependency violations. As a result, some situations may require using - -force and --nodeps together. Common uses of --force include installing an older version of the same package (perhaps because the newer version is too buggy), reinstalling deleted files, and restoring altered files to their pristine state.

The following command demonstrates installing an RPM:

Preparing... ########################################### [100%]

1:fortune-mod ########################################### [100%]

Figure 23-2 demonstrates using Gnome-RPM to install an RPM.

fortune-mod j

Size: 302824 Install Date: not installed Build Host: ratbert.pp.ualr.edu Build Date: Tue Aug 15 02:41:01 GMT 2000 Distribution: <none> Vendor: Chris Ausbroofcs <[email protected] Group: Amusements/Games Packager: Chris Ausb rooks

=ortune-mod contains the ever-popular fortune program. Want a little bit of random wisdom revealed to you when you log in? Fortune's your program.

D |c| s| Path

A

/etc/profile.d/fortune.sh /u s r/b in/rand str /u s r/b in/rot /usr/bir/strflle /usr/bin/unstr

/usr/doc/fortune-mod-1.2.1 D /usr/doc/fortune-mod-1.2.1/AUTHORS D /usr/doc/fortune-mod-1,2.1/COPVING D /usr/doc/fortune-mod-1.2.1 /Chan geLog

/

^^ Install j Upgrade | Check Sig | )C Close |

Figure 23-2: Gnome-RPM easily installs RPM packages.

Figure 23-2: Gnome-RPM easily installs RPM packages.

The next example shows the error generated by trying to install a package already installed and how to use - -force to ignore the error.

Preparing... ########################################### [100%]

package fortune-mod-1.2.1-1 is already installed

Preparing... ########################################### [100%]

1:fortune-mod ########################################### [100%]

--force caused RPM to ignore the conflict and perform the installation. To avoid encountering such conflicts, use the --test option, as shown in the next command, to perform a "dry run" installation to catch any problems:

Preparing... ########################################### [100%]

package fortune-mod-1.2.1-1 is already installed

As you can see in the example, adding - -test to the command line generated an error message. What you cannot see is that neither RPM's databases nor any files changed. Testing a package installation using --test is great protection against the heartburn caused by installing incompatible software.

Computer Hard Drive Data Recovery

Computer Hard Drive Data Recovery

Learn How To Recover Your Hard Drive Data After A Computer Failure.

Get My Free Ebook


Post a comment