CentOS rpm and Yum

Source: Internet
Author: User
Tags gpg

The software installation of CentOS can be broadly divided into two types:

[centos]rpm file installation, use RPM directive similar to [Ubuntu]deb file installation, use dpkg directive [Centos]yum Install similar [ubuntu]apt-get install

RPM command

(a) query system installed software information

For a RPM package, there are "-" and "." Consists of the following parts: * Package Name * Version Information * Release version number * Run platform when Noarch appears, represents software can be platform compatible

1) Check the software that is already installed in the system

Rpm-qa

2) query which package a file is already installed in;

RPM-QF absolute path to file name

3) query where the installed packages are installed;

Software name definition is: RPM Package removal platform information and suffix information

RPM-QL Software Name

4) query information for an installed package

Rpm-qi Software Name

5) Check the configuration file of the installed software;

RPM-QC Software Name

6) View a document where the software has been installed:

RPM-QD Software Name

7) Check the packages and files on which the software is installed;

RPM-QR Software Name


(b) For non-installed package information query

1) To view the use of a software package, version and other information;

Rpm-qpi rpm File

2) View the files contained in a package;

RPM-QPL rpm File

3) View the location of the package's documentation;

RPM-QPD rpm File

4) View the configuration file of a package;

RPM-QPC rpm File

5) View dependencies for a package

RPM-QPR rpm File


(iii) installation, upgrading, deletion of software packages, etc.

1) Install or upgrade a RPM package

RPM-IVH rpm File "Install" RPM-UVH rpm file "Update"

2) Delete a RPM package

RPM-E Software Name

How to force removal of software, regardless of dependencies, and add--nodeps after the above command


(iv) Signature Import

RPM--import Signature file rpm--import Rpm-gpg-key

Yum command

(i) the basic concept of Yum

1) What is Yum?

Yum = Yellow Dog Updater, Modified main function is more convenient to add/remove/update RPM packages.  It can automatically solve the dependency problem of the package. It makes it easy to manage a large number of system update issues

2) Features of Yum

Multiple repository (Repository) Concise profiles can be configured at the same time (/etc/yum.conf automatically resolves dependency issues encountered when adding or removing RPM packages easy to maintain consistency with RPM database

3) Yum Installation

CentOS comes with (yum-*.noarch.rpm) #rpm-IVH yum-*.noarch.rpm first need to import the system's Rpm-gpg-key before enabling Yum for the first time:


(ii) Use of Yum directives

When using the Yum management software for the first time, Yum will automatically download the required headers placed in the/var/cache/yum directory;

1) Update of RPM package


#检查可以更新的软件包 yum check-update #更新所有的软件包 yum update #更新特定的软件包 yum update kernel #大规模的升级 yum upgrade


2) Installation and removal of RPM packages

#rpm包的安装和删除 yum install xxx "service name" yum remove xxx "service name"

3) information about the Yum cache


#清楚缓存中rpm包文件 Yum Clean Packages #清楚缓存中rpm的头文件 Yum-headers #清除缓存中旧的头文件 yum clean-old headers #清除缓存中旧的rpm头文件和包文件 Yum Clean all


4) Package Information query

#列出资源库中所有可以安装或更新的rpm包 Yum list #列出资源库中特定的可以安装或更新以及已经安装的rpm包 yum list firfox* N: You can use wildcards in RPM package names to query for similar RPM packages # Lists all the RPM packages that can be updated in the Repository Yum list updates #列出已经安装的所有的rpm包 yum list installed #列出已经安装的但是不包含在资源库中的rpm包 yum list Extras N: installed through downloads such as Web sites RPM Package #rpm包信息显示 (info parameter with list), lists all the RPM packages that can be installed or updated in the repository yum info #列出资源库中特定的可以安装或更新以及已经安装的rpm包的信息 yum info firefox* N: You can use the match character in the RPM package name #列出资源库中所有可以更新的rpm包的信息yum info updates #列出已经安装的所有的rpm包的信息 Yum info installed #列出已经安装的但是不包含在资源库中的rpm包的信息 Yum Info Extras N: Information on RPM packages installed via downloads like website # Search for RPM packages matching specific characters Yum search firofox# searches for RPM packages with specific files Yum provides Firefox



(iii) Yum software source update

Http://mirrors.163.com/.help/centos.html


CentOS rpm and Yum

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.