Installing
RPM packages typically have file names like foo-1.0-1.i386.rpm
. The file name includes the package name (foo
), version (1.0
), release (1
), and architecture (i386
). To install a package, log in as root and type the following command at a shell prompt:
rpm -ivh foo-1.0-1.i386.rpm
Alternatively, the following command can also be used:
rpm -Uvh foo-1.0-1.i386.rpm
If the installation is successful, the following output is displayed:
Preparing... ########################################### [100%] 1:foo ########################################### [100%]
As you can see, RPM prints out the name of the package and then prints a succession of hash marks as a progress meter while the package is installed.
The signature of a package is checked automatically when installing or upgrading a package. The signature confirms that the package was signed by an authorized party. For example, if the verification of the signature fails, an error message such as the following is displayed:
error: V3 DSA signature: BAD, key ID 0352860f
If it is a new, header-only, signature, an error message such as the following is displayed:
error: Header V3 DSA signature: BAD, key ID 0352860f
If you do not have the appropriate key installed to verify the signature, the message contains the word NOKEY
such as:
warning: V3 DSA signature: NOKEY, key ID 0352860f
Refer to "Checking a Package's Signature" for more information on checking a package's signature.
If you are installing a kernel package, you should use If a package of the same name and version is already installed, the following output is displayed:
However, if you want to install the package anyway, you can use the This option is helpful if files installed from the RPM were deleted or if you want the original configuration files from the RPM to be installed. If you attempt to install a package that contains a file which has already been installed by another package, the following is displayed:
To make RPM ignore this error, use the RPM packages may sometimes depend on other packages, which means that they require other packages to be installed to run properly. If you try to install a package which has an unresolved dependency, output similar to the following is displayed:
If you are installing a package from the Community Enterprise Linux CD-ROM set, it usually suggest the package(s) needed to resolve the dependency. Find the suggested package(s) on the Community Enterprise Linux CD-ROMs or from CentOS Network , and add it to the command:
If installation of both packages is successful, output similar to the following is displayed:
If it does not suggest a package to resolve the dependency, you can try the To force the installation anyway (which is not recommended since the package may not run correctly), use the rpm -ivh
instead. Refer to Manually Upgrading the Kernel for details.
Package Already Installed
Preparing... ########################################### [100%]
package foo-1.0-1 is already installed
--replacepkgs
option, which tells RPM to ignore the error:
rpm -ivh --replacepkgs foo-1.0-1.i386.rpm
Conflicting Files
Preparing... ########################################### [100%]
file /usr/bin/foo from install of foo-1.0-1 conflicts with file from package bar-2.0.20
--replacefiles
option:
rpm -ivh --replacefiles foo-1.0-1.i386.rpm
Unresolved Dependency
error: Failed dependencies:
bar.so.2 is needed by foo-1.0-1
Suggested resolutions:
bar-2.0.20-3.i386.rpm
rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-3.i386.rpm
Preparing... ########################################### [100%]
1:foo ########################################### [ 50%]
2:bar ########################################### [100%]
-q --whatprovides
option combination to determine which package contains the required file.
rpm -q --whatprovides bar.so.2
--nodeps
option.