Rpm course details

Source: Internet
Author: User

Installation package:

Rpm-I full name

Delete:

Rpm-e name (not the package name)

Parameters:

-IVH gets a detailed installation process-nodeps ignore dependency-Force installation-u package name: upgrade and install-F update -- replacepkgs will ignore this error message-VIH -- replacepkgs-Q name: query-Qa query all installed RPM-Qi name query the software details-QL display list-QF path: query which package a file belongs to-QP package name: check the file-qpl package name: For an uninstalled package rpm-QC configuration file

Verification:

Rpm-varpm-VF/bin/lsrpm-VP package name 5 -- MD5 checksum and S -- file length L -- symbol link t -- file modification date d -- device u -- User g -- User Group M -- mode (including license and file type )? -- Unreadable File
Rpm course details
Rpmrpm has five basic operation modes (excluding package compilation): installation, uninstallation, upgrade, query, and verification. This section describes them one by one. To learn the complete details and options, you can use rpm -- help or go to the section called and other RPM resources to get more information about rpm.
1. Install
A typical RPM has a name like a foo-1.0-1.i386.rpm that specifies the package name (FOO), version (1.0), Release number (1), and hardware platform (i386 ). To install a software package, simply type the following command: # rpm-IVH foo-1.0-1.i386.rpmfoo ################################### # As you can see, rpm prints the package name (not necessarily the same as the file name, which may be 1.rpm), and then prints a series of # numbers to indicate the installation progress. Note that although the rpm-IVH foo-1.0-1.i386.rpm is typically used to install the package, it can also be replaced with an rpm-Uvhfoo-1.0-1.i386.rpm. -U is the package upgrade parameter and can be used to install a new package. For more information about how to use the-u parameter in rpm, see upgrade. The installation design of the software package is very simple, but the following error may occur: The software package has been installed. If the software package has been installed, the following information appears: # rpm-IVH foo-1.0-1.i386.rpmfoo package foo-1.0-1 is already installederror: foo-1.0-1.i386.rpm cannot be installed # If you still want to install the package, you can use the -- replacepkgs option in the command line so that RPM ignores this error message: # rpm-IVH -- replacepkgs foo-1.0-1.i386.rpmfoo ################################# #### file conflict if one of the software packages to be installed has been installed when other packages are installed, the following information is displayed: # rpm-IVH foo-1.0-1.i386.rpmfoo/usr/bin/Foo conflict S with file from bar-1.0-1error: foo-1.0-1.i386.rpm cannot be installed # Use the -- replacefiles command line option to make RPM ignore this error message: # rpm-IVH -- replacefiles foo-1.0-1.i386.rpmfoo ################################# #### unresolved dependencies an RPM package may "depend" on other software packages, that is to say, a specific software package must be installed before it can be installed. If this dependency is not resolved when you install this package, you will see: # rpm-IVH bar-1.0-1.i386.rpmfailed dependencies: foo is needed by bar-1.0-1 # This problem can be solved only after installing the dependent software package. If you want to force the installation (this is not a good solution, because the installed software package may not run normally), you can use the -- nodeps command line option.
2. Uninstall
Uninstalling a package is as simple as installing a package: # rpm-e Foo # note that the package name "foo" is used here, rather than the file name "foo-1.0-1.i386.rpm" of the original package ". When detaching a package, replace the foo package name with the actual file name of the original package. When a software package is uninstalled, a dependency error may occur, indicating that there is an installation dependency between other packages and the package. For example: # rpm-e fooremoving these packages wocould break dependencies: foo is needed by bar-1.0-1 # This error should be ignored when rpm is uninstalled (this is not a good solution, because the software package that is dependent on it may not run normally after it is uninstalled), use the -- nodeps command line option.
3. Upgrade
The upgrade package is similar to the installation package. # Rpm-uvh foo-2.0-1.i386.rpmfoo ################################### # rpm will automatically uninstall the installed Foo software package of the old version, the user cannot see the relevant information. In fact, you may always use-u to install the software package, because it can run normally even if it has not been installed before. Because RPM performs an intelligent software package upgrade and automatically processes the configuration file, the following information is displayed: Saving/etc/Foo. conf as/etc/Foo. conf. rpmsave indicates the modification to the configuration file, which may not be "up compatible. Therefore, RPM backs up the original file and installs the new file. The user should resolve the differences between the two configuration files as soon as possible so that the system can continue to run normally. The upgrade is a combination of package uninstallation and installation, and may also encounter errors that may occur in those operations. Again, when you upgrade a new version of the software using the old version of the RPM package, the following information is generated: # rpm-uvh foo-1.0-1.i386.rpmfoo package foo-2.0-1 (which is newer) is already installederror: foo-1.0-1.i386.rpm cannot be installed # To force "Upgrade" with rpm, use the -- oldpackage command line parameter: # rpm-uvh -- oldpackage foo-1.0-1.i386.rpmfoo ################################# ####
4. Update
The package update is similar to the package upgrade: # rpm-fvl foo-1.2-1.i386.rpmfoo ################################### # rpm update options, is to check whether the package version specified in the command line is consistent with the package version installed in the system. When the RPM update option finishes processing the new version of the installed package, the package will be upgraded to the new version. However, the RPM update option cannot install software packages that are not currently available in the system. This is different from RPM upgrade. The upgrade option can install the software package, regardless of whether the old version package is installed. The RPM update option can be used to update a software package or a group of software packages. If you download a large number of software packages but only want to upgrade the existing packages in the system, the RPM update option is very useful. Using the RPM update option means that you do not need to pick and pick the downloaded package or delete the unwanted package beforehand. In this case, you only need to enter # rpm-fvl *. The rpmrpm tool will automatically upgrade the installed packages.
5. Query
Run the command rpm-Q to query the database of the installed software package. The simple command rpm-Q Foo will print out the foo package name, version number and line number: # rpm-Q foofoo-2.0-1 # In addition to the specified package name, you can also use the following option with-Q to specify which packages you want to query. These options are called software package-specific options. -A: Query all installed software packages. -F queries software packages that contain files. -P: query the packages with the file name. You can specify the information displayed when querying a software package in several ways. The following options can be selected and displayed. Such an option is called an Information Selection option. -I: displays the software package information, such as description, Release number, size, compilation date, installation date, hardware platform, and other information. -L list the files contained in the software package. -S: displays the status of all files in the package. -D: list the files marked as documents (such as man manual, info information, README, and so on ). -C: List the files marked as configuration files. These files must be customized after installation, such as sendmail. cf, passwd, inittab, and so on ). If you want to display the file list while executing the above options, you can use the-V command line option at the same time to get the output similar to the LS-l format.
6. Verification
Package verification compares the file information installed in the software package with the same information of the original file in the software package. Similar to other verifications, package verifications compare the file length, MD5 checksum, license, type, file owner, and group. Run the rpm-V command to verify the package. You can use the select option of each package to list the query results of the validation package. You can simply use rpm-V Foo to verify all files in the original installation of the foo package. For example, verify a software package that contains a specific file: rpm-VF/bin/VI verify all installed software packages: rpm-va verify installed software packages with the RPM package file: rpm-VP foo-1.0-1.i386.rpm can be used for verification if you are concerned that the RPM database is corrupted. If the verification result is normal, no output is generated. If there is any inconsistency, it will be displayed. The output format is an 8-bit long string. "C" is used to indicate the configuration file, followed by the file name. An 8-character long character, each representing the result of comparing the attributes of a file with those recorded in the RPM database. "." (Point) indicates that the test has passed. The following characters indicate a test failure: 5 -- MD5 checksum and S -- file length L -- symbolic link t -- file modification date d -- device u -- User g -- User Group M -- mode (including license and file type )? -- If the unreadable file has information output, the user should seriously consider whether the file should be deleted, re-installed, or fixed.

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.