CentOS uses yum for software package management-Linux general technology-Linux technology and application information. The following is a detailed description. This article focuses on two main points: one is how yum is used, and the other is how to find a fast domestic source. In this way, the general usage process of yum is solved.
1. Use of yum:
1) Update the package
1.1) check the updatable package: yum check-update
1.2) update all packages: yum update
1.3) update the specified package: yum update package_name
1.4) Version upgrade: yum upgrade
2) package installation and Deletion
2.1) yum install package_name
2.2) yum remove package_name
3) Search for packages
3.1) search for a specific package: yum search package_name
3.2) Search for a package containing a specific file name: yum provides name
4) package list
4.1) list all installed or updated packages: yum list
4.2) list the specified package: yum list name
4.3) list updatable packages: yum list updates
4.4) list installed packages: yum list installed
4.5) list packages installed but not included in the resource library: yum list extras
2. yum source settings
2.1) Speed up yum download: yum-y install yum-fastestmirror, named yum-plugin-fastestmirror on CentOs 4
2.2) yum source file:/etc/yum. repos. d/CentOS-Base.repo
2.3) CentOS 5 yum source is set to Shanghai Jiao Tong University website
CentOS-Base.repo
[Base]
CentOS-5-Base
# Items list = http://mirrorlist.centos.org /? Release = $ releasever5 & arch = $ basearch &
Repo = OS
# Baseurl = http://developer.centos.org/centos/?releasever/ OS /?basearch/
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Released updates
[Update]
CentOS-5-Updates
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = updates
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Packages used/produced in the build but not released
[Addons]
CentOS-5-Addons
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = addons
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Additional packages that may be useful
[Extras]
Name = CentOS-5-Extras
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = extras
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Additional packages that extend functionality of existing packages
[Centosplus]
CentOS-5-Plus
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = centosplus
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-5-Contrib
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = contrib
Baseurl = http://ftp.sjtu.edu.cn/centos/5.0/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
A. Execute
64-bit:
Rpm -- import http://ftp.sjtu.edu.cn/centos/5.0/ OS /x86_64/RPM-GPG-KEY-CentOS-5
32-bit:
Rpm -- import http://ftp.sjtu.edu.cn/centos/5.0/ OS /i386/RPM-GPG-KEY-CentOS-5
B. Execute yum update.
2.4) set the yum source to a domestic server
# CentOS-Base.repo
#
# This file uses a new release list system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and
# Update status of each mirror to pick mirrors that are updated to and
# Geographically close to the client. You shoshould use this for CentOS updates
# Unless you are manually picking other mirrors.
#
# If the specified list = does not work for you, as a fall back you can try
# Remarked out baseurl = line instead.
#
[Base]
CentOS-5-Base
Base url = http://mirror.be10.com/centos/5/ OS /i386/
Gpgcheck = 1
# Released updates
[Update]
CentOS-5-Updates
Base url = http://mirror.be10.com/centos/5/updates/i386/
Gpgcheck = 1
# Packages used/produced in the build but not released
[Addons]
CentOS-5-Addons
Base url = http://mirror.be10.com/centos/5/addons/i386/
Gpgcheck = 1
# Additional packages that may be useful
[Extras]
Name = CentOS-5-Extras
Base url = http://mirror.be10.com/centos/5/extras/i386/
Gpgcheck = 1
# Additional packages that extend functionality of existing packages
[Centosplus]
CentOS-5-Plus
Base url = http://mirror.be10.com/centos/5/centosplus/i386/
Gpgcheck = 1
Enabled = 0
# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-5-Contrib
Base url = http://mirror.be10.com/centos/5/contrib/i386/
Gpgcheck = 1
Enabled = 0
# Packages in testing
[Testing]
CentOS-5-Testing
Base url = http://mirror.be10.com/centos/5/testing/i386/
Gpgcheck = 1
Enabled = 0
A. Run: rpm -- import http://mirror.be10.com/centos/RPM-GPG-KEY-CentOS-5
3. This article is only about the basic use of yum, and there are still many areas not involved. However, the basic usage is sufficient.
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