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 elm packages from files in the current directory:

            rpm -ivh pine-4.33-8.i386.rpm elm-2.5.3-11.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 successfully installs 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 the ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.