Do you play games? Management of software packages (i)--rpm

Source: Internet
Author: User

RPM Package Manager (RPM, all referred to as the RPM Packages Manager) is a widely used software package management system under Linux. RPM This noun may refer to a. rpm file format package, or it may refer to its own Package Manager (RPM Packages Manager). Originally developed by Red Hat, it is now also developed by the open source community. RPM is usually included with Linux distributions, but there are also releases (such as Gentoo) that are released separately as application software. RPM is only suitable for installing software packaged with RPM and is currently one of the most versatile package types under Gnu/linux. --Wikipedia

A large part of the awkward position of Linux on the desktop is due to the lack of entertainment software and the difficulty of software installation, and today we will talk about the content of software package management under Linux.

I think the Wikipedia explanation for RPM is not too good, earlier RPM was called: Red Hat Package Manager, and later because the use of a lot of people are also very useful, the Linux standard base defined as the Linux Packages Manager standards are renamed to RPM The form of recursive indentation for Package manager. Before contacting Linux, I always felt that the installation of the game was very mysterious, it could combine so many things together and be controlled by the players, and after contacting with the installation of the Linux software package, it was just that some files were placed in a certain directory.

Let's meet first. RPM Package Name:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5F/A7/wKiom1UqOPrD2RXoAABIgXGhhis328.jpg "title=" 4w2wj% pz90568or0o "_9rn.png" alt= "Wkiom1uqoprd2rxoaabigxghhis328.jpg"/>

It is one of these forms:

appname-version-release.arch.rpm

VERSION:

Major: Major Version number

Minor: Minor version number

Release: Release number

RELEASE: The revision number of the package itself, and sometimes the OS information that is applicable to it;

Like 2.centos6 in bash-4.3.2-2.centos6.x86_64.rpm.

ARCH: the applicable platform

X86:i386, i486, i586, i686

x86_64:x86_64, AMD64

Powerpc:ppc

Noarch: Nothing to do with the platform;

We're not going to do a lot of explaining about RPM, because in practice yum (the next one is him) has almost replaced RPM because it involves dependencies when installing a package, specifically: you install a B or b library, then you have to pack B, but B needs C, Even more abominable is the possibility that C needs a. OMG, you'll find yourself falling into a bottomless pit.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5F/A9/wKiom1UqO6fhp4gBAAC4vbTK5UA081.jpg "title=") ehn8m (ziv~ ' W6lfqy3z{fx.png "alt=" Wkiom1uqo6fhp4gbaac4vbtk5ua081.jpg "/>

RPM-IVH in the figure shows the detailed information human readable mode display installation process, uninstall is RPM-E, use is very simple, no longer, the following details about the use of rpm-q (or the form of text):

Query whether a package has been installed, and check all installed packages, and can view details of a package;


RPM {-q|--query} [select-options] [query-options]


[Select-options]:

1, query whether a package or some packages are installed:

Rpm-q package_name ...


2. Query all packages that have been installed:

Rpm-qa


## [email protected] packages]# Rpm-qa | Wc-l--See how many packages are installed

## [email protected] packages]# Rpm-qa | grep ' yum* '--Find a specific package

3. Query which package the file is generated by:

Rpm-qf/path/to/somefile


4. Query for information about package files that have not been installed

-P

# Rpm-qpi Package_file

##[[email protected] packages]# rpm-qpi ruby-1.8.7.374-2.el6.x86_64.rpm-View the information of the not loaded RPM package, must write the full-package name



[Query-options]:

1, query the brief description of a package information:

Rpm-qi package_name


## [email protected] packages]# Rpm-qi Yum-pack details

# #Name: Yum relocations (can change installation path): (Not relocatable)

# #Version: 3.2.29 Vendor (supplier): CentOS

# #Release: 60.el6.centos Build Date (build time): Thu Oct 11:15:10 PM CST

# #Install Date:thu 08:45:50 AM CST Build host (on which host): c6b8.bsys.dev.centos.org

# #Group: System environment/base source RPM (source bundle): yum-3.2.29-60.el6.centos.src.rpm

# #Size: 4776299 License (following protocol): gplv2+

# #Signature: RSA (signature source)/SHA1 (integrity check), Sat Oct 03:53:51 AM CST, Key ID 0946fca2c105b9de

# #Packager (the person who created the package): CentOS Buildsystem

# #URL: http://yum.baseurl.org/

# #Summary: RPM Package Installer/updater/manager

# #Description:

# #Yum is a utility so can check for and automatically download and

# #install updated RPM packages. Dependencies is obtained and downloaded

# #automatically, prompting the user for permission as necessary.

2. Query the list of files generated by a package installation:

RPM-QL package_name


3. Query all the configuration files generated after the installation of a package is complete:

RPM-QC package_name


## [email protected] packages]# RPM-QC Yum---Query package configuration file

4. Query all the Help files generated after the installation of a package is complete:

RPM-QD package_name


5. Check the Changelog information when the package is made with the version change:

Rpm-q--changelog Package_name

##[[email protected] packages]# rpm-q--changelog Yum-View the update log for RPM packages


6. Query the capabilities provided by a package:

Rpm-q--provides Package_name

##[[email protected] packages]# rpm-q--provides Yum--view the capabilities capabilities provided by the RPM package

7, query the capabilities that a package depends on:

Rpm-q--requires Package_name

##[[email protected] packages]# rpm-q--requires Yum--view the capabilities that RPM packages depend on

8. Execute the script when you query a package for installation or uninstallation:

Rpm-q--scripts Package_name


There are four types of scripts:

Preinstall: Scripts executed before the installation process begins;

Postinstall: Scripts executed after the installation process is complete;

Preuninstall: The script executed before the uninstallation begins;

Postuninstall: Scripts executed after the uninstallation process is completed;


##[[email protected] packages]# rpm-q--scripts zsh-View RPM package execution steps when installing or uninstalling

# #postinstall Scriptlet (using/bin/sh):--scripts run at install time

## if [!-f/etc/shells]; Then

## echo "/bin/zsh" >/etc/shells

## Else

## grep-q "^/bin/zsh$"/etc/shells | | echo "/bin/zsh" >>/etc/shells

## fi

##

## if [-f/usr/share/info/zsh.info.gz]; Then

## # # needed so that--excludedocs works.

##/sbin/install-info/usr/share/info/zsh.info.gz/usr/share/info/dir \

# #--entry= "* zsh: (zsh). an enhanced Bourne shell. "

## fi

##

##:

# #preuninstall Scriptlet (using/bin/sh):--Scripts executed before uninstallation

## if ["$" = 0]; Then

## if [-f/usr/share/info/zsh.info.gz]; Then

## # # needed so that--excludedocs works.

##/sbin/install-info--delete/usr/share/info/zsh.info.gz/usr/share/info/dir \

# #--entry= "* zsh: (zsh). an enhanced Bourne shell. "

## fi

## fi

##:

# #postuninstall Scriptlet (using/bin/sh):--Scripts executed after uninstallation

## if ["$" = 0]; Then

## if [-f/etc/shells]; Then

## tmpfile= '/bin/mktemp/tmp/.zshrpmxxxxxx '

## grep-v ' ^/bin/zsh$ '/etc/shells > $TmpFile

## cp-f $TmpFile/etc/shells

## rm-f $TmpFile

## fi

## fi

Check:

Whether the files generated after the query package installation have changed


RPM {-v|--verify} [select-options] [verify-options]


Common usage: rpm-v package_name


S file Size differs

M Mode differs (includes permissions and file type)

5 Digest (formerly MD5 sum) differs

D Device Major/minor number mismatch

L Readlink (2) path mismatch

U User ownership differs

G Group ownership differs

T MTime differs

P capabilities differ


##[[email protected] packages]# rpm-v Yum--see if the package configuration file changes

## S.5 .... T. c/etc/yum.conf----the representative has not changed, the letter represents the change

# # S File size differs---File size

# #M Mode differs (includes permissions and file type)--Files permissions

# #5 Digest (formerly MD5 sum) differs--file contents, signatures

# # D device Major/minor number mismatch--Device #

# # L Readlink (2) path mismatch--

# # U User ownership differs-to-owner

# # G Group ownership differs---group

# # T MTime differs--access time

# # P capabilities differ- -Features


Verification of the validity of the package:

SOURCE valid:

Provided by our trusted creators

Dependent on: The digital signature of the creator; The signature is performed by the author using its own private key encryption package;

Content Legal:

The package has not been modified two times; Integrity Check succeeded

Dependent on: The program signature provided by the creator;

Verification method: The installer uses the same signature extraction algorithm to extract the signature of the package and compare it with the original provider;


The source and completeness of the package in its CD-ROM:

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


Example: # RPM--import rpm-gpg-key-centos-6


Verify: RPM {-k|--checksig} package_file

--nosignature: Does not check the legitimacy of the source

--nodigest: Do not check integrity


##[[email protected] media]# rpm--import rpm-gpg-key-centos-6-Import Password file

##[[email protected] packages]# rpm-k yum-3.2.29-60.el6.centos.noarch.rpm-Verify RPM package is legitimate

## Yum-3.2.29-60.el6.centos.noarch.rpm:rsa SHA1 (MD5) PGP MD5 OK

##[[email protected] packages]# rpm-k--nosignature yum-3.2.29-60.el6.centos.noarch.rpm-No signature verification

## YUM-3.2.29-60.EL6.CENTOS.NOARCH.RPM:SHA1 MD5 OK

##[[email protected] packages]# rpm-k--nodigest yum-3.2.29-60.el6.centos.noarch.rpm-No authentication integrity

## YUM-3.2.29-60.EL6.CENTOS.NOARCH.RPM:RSA (MD5) PGP OK

RPM Manager database:/var/lib/rpm

##/var/lib/rpm---RPM manager database, all the information for all packages installed in RPM is stored here

Rebuild the database:

RPM {--INITDB|--REBUILDDB} [-v] [--dbpath DIRECTORY]


--INITDB: Initializes the database, that is, when the database is completely saved, it can be created;


--REBUILDDB: Whether the current data exists or not, the library will be rebuilt directly;

Other ways to use RPM Let's use the man command to see it, and we'll focus on the next yum.

I hope this article can help you, if there are errors please correct me, humbly!

This article is from the "Linuxlove" blog, make sure to keep this source http://linuxlover.blog.51cto.com/2470728/1631560

Do you play games? Management of software packages (i)--rpm

Related Article

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.