Learn to use RPM

Source: Internet
Author: User
Article title: active and active RPM. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Zhang Heng
  
Red Hat Linux is one of the most popular releases. For Red Hat Linux, RPM is used to install, update, or uninstall software. RPM is a practical tool for Red Hat Linux. it can automatically install software and be used freely without being limited by Red Hat's release version. By using the RPM tool, the application is forcibly re-created when the installation file is created. In this way, ensure that all resources exist and re-compile in the correct position.
  
RPM has five basic operations (not including creating software packages), such as installation, uninstallation, update (or upgrade), query, and software package authentication.
  
Install
  
To install binary. rpm files, first copy them to the machine and run the following command to install them:
  
# Rpm-I zsh-3.0.5-10.i386.rpm
  
If you want feedback about the installation process, enter the following command:
  
# Rpm-ivh zsh-3.0.5-10.i386.rpm
  
Because the Command uses the VL option, the RPM will display a process bar to add a line for the # symbol. When the # symbol reaches the edge of the screen and the command prompt is returned, the software package is installed.
  
RPM packages typically have file names similar to zsh-3.0.5-10.i386.rpm. This includes the software package name (zsh), version number (3.0.5), release number (10), and hardware platform (i386 ).
  
Before installing the software package, RPM usually checks the database and does not install the existing software package. If you still want to install the software package, you can use the -- replacepkgs option. RPM ignores this error.
  
Other possible errors during installation are file conflicts and unresolved relevance issues. If another software package has already installed the file you want to install, a "file conflict" error will occur. If you want to ignore this error for forced installation, you can use the -- replacefiles option. When a software package depends on other utilities or applications, an unresolved correlation error is generated. you can use the -- nodeps option to ignore this error. However, it is unwise to do so because the installed software package may not be able to run normally.
  
Uninstall
  
To delete the zsh package from the system, run the following command:
  
# Rpm-e zsh
  
Note: the name of the utility is required. If an installed package depends on the package being deleted, this operation fails and generates an error message. Of course, you can also force delete by specifying the-nodeps option, but this will make other packages unable to run normally.
  
Upgrade
  
To upgrade the software, you need to delete all old package versions and install new packages. You can use the following command to complete this operation:
  
# Rpm-Uvh zsh-3.0.5-10.i386.rpm
  
Since the RPM software package is updated using a database, it knows when the preparation file is no longer compatible. If no backup is created, it will not delete these files first, and notify the user to save all the files and their names at the beginning of the upgrade. You can use the -- oldpackage option to replace an older version with a newer package.
  
Query
  
Save all the databases that have installed software packages for information about those software packages. You can use the following command to perform a simple query:
  
# Rpm-q zsh
  
Show the package name:
  
Zsh-3.0.5-10
  
Other options added to the query command include:
  
-A: displays all installed software packages. -F displays the software packages that have the given file. -P provides the same output result as the "-q" option, but uses the complete. rpm file name. -I: displays software package information such as name, description, and release status. -L list the files in the software package. -S: displays the files marked as documents in the software package. -C: list the files marked by the configuration file. -V is used with the option to display the file list. the ls-l format information is displayed.
  
Inspection
  
Testing is another useful feature of RPM. When installing a software package, you may encounter modifications to the configuration file or accidental deletion of the file. this program can quickly track any subsequent faults and compare the current installation file with the original binary file. by comparing rpm, we can find the difference between the two. The group tested includes the size, MD5 check, permission, type, owner, and installed files and directories. If no difference is found, no information is displayed. The command used to verify the software package is as follows:
  
# Rpm-V zsh
  
If it is determined that the software package is inconsistent after installation, you can reinstall the software package by using the-replacepkgs option.
  
  
  
  
  

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.