English French
Using RPM
[application]*RPM* has five basic modes of operationindexterm:[RPM,basic modes] (not counting package building): installing, uninstalling, upgrading, querying, and verifying. This section contains an overview of each mode. For complete details and options, try [command]#rpm --help# or see *rpm*(8). Also, see xref:RPM.adoc#s1-rpm-additional-resources[Additional Resources] for more information on [application]*RPM*.
Installing and Upgrading Packages
indexterm:[RPM,installing]indexterm:[RPM,upgrading]indexterm:[packages,installing RPM]indexterm:[packages,upgrading RPM]indexterm:[RPM,file name] [application]*RPM* packages typically have file names in the following form:
package_name-version-release-operating_system-CPU_architecture.rpm
For example the `tree-1.7.0-3.{PKGOS}.x86_64.rpm` file name includes the package name (`tree`), version (`1.7.0`), release (`3`), operating system major version (`{PKGOS}`) and *CPU* architecture (`x86_64`).
Important
When installing a package, ensure it is compatible with your operating system and processor architecture. This can usually be determined by checking the package name. For example, the file name of an [application]*RPM* package compiled for the AMD64/Intel{nbsp}64 computer architectures ends with `x86_64.rpm`.
The [option]`-U` (or [option]`--upgrade`) option has two functions, it can be used to:
upgrade an existing package on the system to a newer version, or
install a package if an older version is not already installed.
The [command]#rpm -U _package.rpm_pass:attributes[{blank}]# command is therefore able to either *upgrade* or *install*, depending on the presence of an older version of _package.rpm_ on the system.
Assuming the `tree-1.7.0-3.{PKGOS}.x86_64.rpm` package is in the current directory, log in as `root` and type the following command at a shell prompt to either upgrade or install the [package]*tree* package:
~]#{nbsp}rpm -Uvh tree-1.7.0-3.{PKGOS}.x86_64.rpm
Use -Uvh for nicely-formatted RPM installs
The [option]`-v` and [option]`-h` options (which are combined with [option]`-U`) cause [application]*rpm* to print more verbose output and display a progress meter using hash signs.
If the upgrade or installation is successful, the following output is displayed:
Preparing... ########################################### [100%]
1:tree ########################################### [100%]
Always use the -i (install) option to install new kernel packages!
[command]#rpm# provides two different options for installing packages: the aforementioned [option]`-U` option (which historically stands for *upgrade*), and the [option]`-i` option (which historically stands for *install*). Because the [option]`-U` option includes both install and upgrade functions, the use of [command]#rpm -Uvh# with all packages, *except kernel packages*, is recommended.