Another article CentOS the rpm and Yum installation method (detailed)

Source: Internet
Author: User
Tags gpg

Original address: http://www.centoscn.com/CentOS/help/2013/1019/1906.html

CentOS Software installation can be roughly divided into two categories:

[centos]rpm file installation, use the RPM instruction  similar to [ubuntu]deb file installation, use dpkg instruction
[Centos]yum installation is   similar [ubuntu]apt-get installation

RPM command

(a) query system installed software information

For an RPM package, there are "-" and "." Composition, basically has the following parts: * Package name * 
Version information * Release version number * Running platform, when appearing Noarch, represents the software can be platform compatible

1 The software that has been installed in the query system

2 Query a file that has been installed to which package;

Absolute path to RPM-QF file name

3 Find out where the installed packages are installed;

Software name definition is: the RPM package to remove platform information and suffix after the information

RPM-QL Software Name

4 Query The information of an installed package

RPM  -qi software name

5 Check the configuration file of the installed software;

RPM-QC Software Name

6 to view a document installation location where the software has been installed:

RPM-QD Software Name

7 Check the software packages and files that have been installed;

RPM-QR Software Name


(ii) query for not installed package information

1) To view the use of a 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 the dependencies of a package

RPM-QPR rpm File


(iii) Package installation, upgrade, deletion, etc.

1 Install or upgrade an RPM package

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

2) Delete an RPM package

RPM-E Software Name

How to need to force the deletion of software regardless of dependency problem, then add--nodeps to the above command


(iv) Signature Import

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

Yum command (i) Yum basic concept 1) Yum is what?

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

2) Characteristics of Yum

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

3) Yum Installation

CentOS (yum-*.noarch.rpm) #rpm-IVH yum-*.noarch.rpm first need to import the Yum of the system before enabling Rpm-gpg-key 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) RPM Package update

#检查可以更新的软件包 
Yum check-update 
#更新所有的软件包 
yum update 

#更新特定的软件包 
yum update kernel 

#大规模的升级 
Yum Upgrade

2) RPM Package installation and removal

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

3) information about the Yum cache

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

4) Package Information query

#列出资源库中所有可以安装或更新的rpm包 
Yum list 

#列出资源库中特定的可以安装或更新以及已经安装的rpm包 
yum list firfox* 
N: Wildcard characters can be used in the RPM package name. Query similar RPM package

#列出资源库中所有可以更新的rpm包 
Yum list updates 

#列出已经安装的所有的rpm包 
yum list installed 

# List the RPM packages that have been installed but not included in the Repository 
yum list Extras 
N: By downloading the installed RPM package  

#rpm包信息显示 (info parameter same 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 a matching character in the RPM package name 

#列出资源库中所有可以更新的rpm包的信息
Yum info updates 

#列出已经安装的所有的rpm包的信息

 Yum info installed 

#列出已经安装的但是不包含在资源库中的rpm包的信息 
Yum info Extras 
N: By downloading the installed RPM package such as the website

#搜索匹配特定字符的rpm包
Yum Search Firofox
#搜索包含特定文件的rpm包
Yum provides Firefox


(iii) Yum software source update

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

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.