Rpm has five basic operation modes: installation, uninstallation, upgrade, query, and verification.
1. install the software package
Syntax: rpm-IVH [RPM package file name]
Option description:
I: indicates that the software package is installed.
V: displays detailed information during installation.
H: displays the horizontal progress bar.
(1) install the foo-2.0-1.i386.rpm Software Package
# Rpm-IVH foo-2.0-1.i386.rpm
If the installation is successful, the system displays the package name, and then prints "#" on the screen to display the installation progress. The following information is displayed:
Preparing... ################################## [100%]
1: Foo ############################### [100%]
If the same version of a software package has been installed, the system displays the following information:
Preparing... #######################################[ 100%]
Package foo-1.0-1 is alread installed
If you still want to install a software package of the same version when the software package is already installed, you can use the "-- replacepkgs" option to ignore the error.
E. g still installs the package when the foo-1.0-1.i386.rpm is installed.
# Rpm-IVH -- replacepkgs foo-1.0-1.i386.rpm
(2) Software Package conflict
If the software package to be installed contains a file that has been installed by another software package or an earlier version of the same software package, the system displays the following information:
Preparing... ################################## [100%]
File/user/bin/Foo from install of foo-1.0-1 conflicts with file from package bar-2.0.20
You can ignore this error by using "-- replacefiles ".
E. g foo-1.0-1.i386.rpm package conflict, ignore errors to continue installation.
# Rpm-IVH -- replacefiles foo-1.0-1.i386.rpm
(3) uninstall the Software Package
Syntax: rpm-E [RPM package name]
Option Description: e: indicates to uninstall the software package.
E. g uninstall the foo Software Package
# Rpm-e foo
Use the package name Foo when uninstalling the package, instead of the package file name foo-1.0-1.i386.rpm.
A dependency error occurs when a software package is uninstalled. When another installed software package depends on the software package you are trying to delete,
A dependency error occurs. E. g
Preparing... ######################################## ### [100%]
Error: removing these packages wowould break dependencies:
Foo is needed by bar-2.0.20-3.i386.rpm
To use RPM to ignore this error and forcibly Delete the software package, you can use the "-nodeps" option, but the software package dependent on it may not run properly.
(4) Upgrade the Software Package
Syntax: rpm-uvh [RPM package file name]
Option Description: U indicates upgrading the Software Package
E. g upgrade foo-2.0-1.i386.rpm Software Package
# Rpm-uvh foo-2.0-1.i386.rpm
The update package is actually a combination of deletion and installation. Therefore, another error occurs during the RPM package upgrade process. If RPM considers that the user tries to upgrade
The system displays the following information for earlier versions of the software package:
# Package foo-2.0-1 (which is newer than foo-1.0-1) is already installed
You can use the "-- oldpackage" option to forcibly upgrade the RPM package.
E. g force upgrade foo-1.0-1.i386.rpm package
# Rpm-uvh -- oldpackage foo-1.0-1.i386.rpm
(5) refresh the Software Package
Syntax: rpm-fvl [RPM package file name]
Option Description: F indicates refreshing the Software Package
E. g refresh foo-2.0-1.i386.rpm Software Package
# Rpm-fvl foo-1.2-1.i386.rpm
When you use RPM to refresh a software package, the system compares the version of the specified software package with the version installed on the system. When the RPM refresh option processes version updates than the installed version, it will upgrade
To the updated version. However, if a software package is not installed before, the RPM refresh option will not install the software package. This is different from the RPM upgrade option, because no matter whether the earlier version of the software package is
Whether the software package is installed or not.
(6) query the Software Package
Run the "rpm-Q" command to query the software package installation information.
A. query the details of a specified software package.
Function Description: This command displays the name, version, and release number of the installed software package.
Syntax: rpm-Q [RPM package name]
E. g. Check whether the foo software package is installed.
# Rpm-Q foo
Package Foo Is Not Installed
// It is found that the foo software package is not installed.
E. g. Check whether the BIND software package is installed.
# Rpm-Qa bind
Binary-9.2.4-2
// Check whether the BIND software package has been installed.
B. query all installed RPM packages in the system
Syntax: rpm-Qa
C. query the description of the specified installed software package
Syntax: rpm-Qi [RPM package name]
Displays the software package name, description, release version, size, manufacturing date, manufacturer, and other miscellaneous.
D. query the list of files contained in the specified installed software package.
Syntax: rpm-QL [RPM package name]
E. Dependency requirements for querying software packages
Syntax: rpm-QR [RPM package name]
F. Specify the software package to which the file belongs in the query system.
Syntax: rpm-QF [file name]
JDK 7 installation for Linux platforms
Http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html#install-32
Http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7