O'Reilly logo

Learning Red Hat Enterprise Linux & Fedora, Fourth Edition by Bill McCarty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

            rpm -ivh nano-1.2.1-4.i386.rpm mutt-1.4.1-3.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 the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required