Installing a Package

To install a package, log in as root and issue the following command from a shell prompt:

            rpm -ivh 
            package

where package specifies the name of the file that contains the package. You can specify multiple packages, as long as you include a space to separate each package name from its neighbor. For example, the following command installs both the pine and mutt packages from files in the current directory:

            rpm -ivh pine-4.44-13.i386.rpm mutt-1.4-4.i386.rpm

The options used with the rpm command include:

-i

This option specifies that RPM should install the package or packages given as arguments.

-h

This option specifies that RPM should print hash marks (#) as it installs the package as a visible indication of progress.

-v

The verbose option specifies that RPM should print messages that summarize its actions and progress.

Generally, RPM will successfully install the specified package. However, errors can occur. RPM may report:

  • That the package is already installed

  • That a package file conflicts with a file from another package

  • A failed dependency

The next three sections explain how to resolve these errors.

Package Is Already Installed

If a package has already been installed, RPM will not overwrite the package without your permission:

# rpm -ivh bad-1.0-1.i386.rpm
bad package bad-1.0-1 is already installed

If you want to overwrite the package, add the -- replacepkgs option to your command:

rpm -ivh --replacepkgs bad-1.0-1.i386.rpm

It may be more appropriate to update ...

Get Learning Red Hat Linux, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.