How to analyze the rpm package management function

PHPz
Release: 2023-05-24 09:01:05
forward
1305 people have browsed it

Full explanation of Rpm package management functions

Function of software package management:Package each component file of the compiled program into one or several packages File, in order to facilitate the installation, upgrade, uninstallation, query, verification, and database maintenance of the program package.

Let’s take a look at the analysis of RPM package management

Rpm package has great applications in redhat and S.U.S.E

We will next use the rpm package in centos system Do some detailed function analysis for management

Using yum (rhel series) to install can automatically resolve dependencies d

rpm package naming format:

name-VERSION-release.arch.rpm

VERSION:major.minor.release

Major: major version number (the version has major updates); minor: minor Version number (minor update)

release.arch: The release number of the rpm package

release.os: 2.el7 (platform).i386 (architecture).rpm architecture (architecture): i386 , x64(amd64), ppc, noarch manager;

Actual operation:

This machine has successfully downloaded zsh-4.3.10-9.el6.x86_64.rpm on the server. Use this To implement

Syntax: rpm [options] [packages_file]

Installation; -i, --install

rpm -ivh /path/to /rpm_package

                                                                                                                                                                                           /rpm_package --nodeps; Ignore dependencies (applicable to uninstallation)

                                                                           and             but but                                      but                                                 to                                                --nodeps; Will overwrite the original information

Rpm -i --replacepkgs /path/to/rpm_name

[root@bucktan ~]# rpm -ivh --replacepkgs zsh-4.3.10-9. el6.x86_64.rpm

Uninstall; -e, --erase

rmp -e package_nameHow to analyze the rpm package management function

--allmatches Uninstall all packages matching the specified name

                                                                                      

#            rpm -U /path/to/rpm_package

                            —oldpackage downgrade

Two packages were taken from the server: zabbix-2.4.0-1.el6.x86_64 .rpm

zabbix-2.4.5-1.el6.x86_64.rpm

Before upgrading to zabbix-2.4.5-1.el6.x86_64 .rpm

[ROOT@Bucktan] ~#RPM-Uvh-OLDPACKAGE ZABBIX-2.4.0-1.el686_64.rpm How to analyze the rpm package management function## Only upgraded; Will not be executed)

rpm -F /path/to/rpm_package

Usually used with vh;

rpm -Uvh|-Fvh /path/to/package

                                                                                                                   With       -- nosignature                                                                                                                                                             .

                                                                                                                       

[query-options]

Query whether the package has been installed;

rpm -q package_name

[select-options]:

rpm -qaQuery all Installed packages;

rpm -qf /path/to/file Query which package a file is generated by;

-q --whatprovides file_name Query which package the specified capability is generated by Provided by

--q-WhatRequires File_name, to query which program package dependence on the specified Capability package

[Query-options]:

How to analyze the rpm package management functionRPM -QL Package_name query the file generated after installation;

rpm -qd package_name queries the help document generated after the package is installed;

rpm -qc package_name queries the configuration file generated after the package is installed; How to analyze the rpm package management function

rpm -qR package_name Query the dependencies of the specified software package

                                                                                                using   using using use using   using   using using   using using     through   using using ‐ ‐ ‐   ‐ ‐ ‐ ‐ ‐ ‐ ‐​ ​                          

## PostInstall to install the rear script How to analyze the rpm package management function

# Preuninstall uninstall the front script

Postuninstall uninstall the rear script

##Q # rpm -qpl package_file Query the files that will be generated after installationHow to analyze the rpm package management function

rpm -qpi package_file Query the simple description information of the package;

It can be used with its options, such as -qp --scripts

Verification; check whether the installed files have been modified

rpm -V package_name

rpm -V zsh

S .5....T. c /etc/zshrc

                                                                                                                                                                                                                                          .

                   M Mode differs (includes permissions and file type)                                                                                                L readLink(2) path mismatch

                                                                                                                                    differ Ability changed

Verify source legitimacy and software integrity

Package integrity; single encryption mechanism (MD5|sha1..)

Source legitimacy; public key encryption mechanism (RSA)

rpm -K /path/to/packagefile directly checks the legitimacy of the source of the package

rpm --checksig /path/to/package_file

-Nosigeature: Do not check the source of the source -NODIGest: Do not check the package integrity during verification

Import GPG key file:

             rpm --import /path/to/gpg-key-file

                                                                                                                                                                                                                                                                    

# Location: /var/lib/rpm

Rebuilding:

rpm --initdb: Initialization

If a database does not exist in advance, create a new one

RPM -Rebuilddb Reconstruction

How to analyze the rpm package management function

The above is the detailed content of How to analyze the rpm package management function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
rpm
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!