Rpm installation package commands

Source: Internet
Author: User
Run the RPM command to query the software package:

1. query all RPM packages installed in the system

$ Rpm-Qa

Query the software packages installed in the current Linux system.

Example: $ rpm-Qa | grep-I X11 | head-3: view the first three packages containing the X11 string in the system.

2. Check whether the software package is installed.

$ Rpm-q rpm package name: Check whether the specified software package is installed in the system.

For example, run $ rpm-Q Bash to check whether the Bash software package is installed in the system.

The software package name specified in the "rpm-Q" command must be accurately spelled. This command does not perform local matching queries in the software package name.

3. query the installed software package details

$ Rpm-Qi RPM package name: query the detailed information of the software package with the specified name in Linux.

For example, $ rpm-Qi bash checks detailed information about the Bash software package.

The execution result of the "rpm-Qi" command contains detailed information, including the software name, version information, package size, description, and so on.

4. query the list of files in the installed software package

$ Rpm-ql rpm package name: queries which files are installed in the current system for installed software packages.

Example: $ rpm-QL bash | head-3 view the list of the first three lines of files installed by bash in the system.

$ Rpm-QL bash | grep bin filters out the list of files containing the bin string in bash.

5. query the software packages of files in the system

$ Rpm-QF file name: queries the software package of the specified file in Linux.

Example: $ rpm-qf/bin/Bash: view the software package to which the bash file belongs.

Bash-3.0-19.2 displays the result.

6. query the information in the RPM installation package file.

$ Rpm-QPI the file name of the RPM package to view the detailed information before the RPM package is installed.

$ Rpm-qpl RPM package file name: view the file list before the RPM package is installed.

"Rpm-QPI and rpm-qpl commands can be used as an understanding of the software package before it is installed.

7. Run the RPM command to query instances.

$ Which Mount obtains the executable file path of the mount command.

$ Rpm-qf/bin/Mount query the packages to which/bin/Mount belongs.

$ Rpm-Qi util-Linux: query the details of the software package of/bin/mount.

$ Rpm-QF util-Linux | grep Mount query/bin/Mount contains all mount-related files.

  Run the RPM command to install the software package:

1. RPM Software Package base Installation

$ Rpm-I RPM installation package file name install the files in this package to the current system, the installation process does not prompt any information.

2. The detailed information is displayed when the software package is installed.

$ Rpm-ivh rpm installation package file to install the files in the package to the current system. The installation process displays the installation progress and other information as a percentage.

3. Dependency of RPM software package installation

Force installation: $ rpm -- force-I RPM package file name

Note: The dependency of the software package must be satisfied before the installation of the software package. The installation of the software package using the force installation command cannot guarantee that the software will be installed on the system.

Therefore, we recommend that you use it with caution.

  Run the RPM command to uninstall the software package:

1. Uninstall the RPM Software Package

$ Rpm-e package name

The software package is uninstalled without any information.

Note: The RPM package can be detached only when no dependency exists.

2. Dependency of RPM package uninstall

When you run the RPM command to uninstall a software package, the RPM command analyzes the dependencies of the software package to be detached. When there is a dependency, the system stops automatically and displays

Software causes the uninstallation failure. Based on the error message prompted by rpm, determine the software package to be uninstalled first, and then uninstall the software package to be depended on.

  Use the RPM command to upgrade the software package:

$ Rpm-u RPM installation package file name

Note: The upgrade package file used in the "rpm-U" command should be the upgrade file officially released by red hat for the current Linux version. We recommend that you do not use the upgrade package provided by a third party.

  Preparations before compiling the application:

1. Check that the compiling environment has been installed in the system.

$ Rpm-Qa | grep gcc

Make sure that the GCC compiler environment is installed in the current system.

2. Download the source code installation package file of the prozilla program.

3. Release the downloaded source code package file

$ Tar jxf prozilla-2.0.4.tar.bz2

Release the source code package to the current directory. Extracted file name: prozilla-2.0.4

Extension: tarxzvf is used to release compressed packages in the tar.gz format.

4. Go to the source code directory.

$ CD prozilla-2.0.4 go to the directory.

$ PWD: displays the current directory path.

/Home/teacher/download/prozilla-2.0.4 display results.

Path for compiling software installation:

$./Configure -- prefix =/home/teacher/proz

In prozilla program configuration, you can use the "-- prdfix" option to specify the installation path after the application is compiled. If you do not use "-- prefix"

The Configure program will configure the default installation path of prozilla to the "/usr/local/bin" directory.

5. Program compilation process

$ Make

Use the make command to compile the binary program.

6. Program Installation Process

$ Make install

The "make install" command installs compiled applications to the target directory according to the installation path set in the "-- prefix" option of the configuer command.

7. Verify the compiled and installed programs

$ Ls/home/teacher/proz

View the files in the proz folder.

Bin include lib man share

Configuration before Compilation


  Compilation and installation:

1. Program compilation process

$ Make

2. Program Installation Process

$ Make install

3. Verify the compiled and installed programs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.