1. Local Yum Source
1. The system has installed the yum software package by default, so you can directly configure it:
[[Email protected] ~] # Cd/etc/yum. Repos. d/Yum source configuration file directory
[[Email protected] yum. Repos. d] # mv CentOS-Base.repo CentOS-Base.repo.bak first rename the network Yum source configuration file (invalidate it)
[[Email protected] yum. Repos. d] # Vim CentOS-Media.repo editing local Yum source files
C6-media
Name = centos-$ releasever-media local Yum source name (can be modified at Will)
Baseurl = file: // MNT/sr0 disk Mount directory/mnt/sr0
Gpgcheck = 1
Enabled = 1 use this yum source (0 is not enabled)
Gpgkey = file: // MNT/sr0/RPM-GPG-KEY-CentOS-6 local Yum source key
Ii. Network Yum source (the premise is that you must be connected to the Internet. The yum source used here is the address of the University of Science and Technology of China:
University of Science and Technology: http://centos.ustc.edu.cn/centos)
[[Email protected] yum. Repos. d] # This step is not required if the MV CentOS-Base.bak CentOS-Base.repo is not renamed before
[[Email protected] yum. Repos. d] # Vim CentOS-Base.repo edit network Yum source file
[Base]
Name = centos-$ releasever-Base
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-6
# Released updates
[Updates]
Name = centos-$ releasever-Updates
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/updates/?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-6
# Additional packages that may be useful
[Extras]
Name = centos-$ releasever-extras
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/extras/?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-6
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = centos-$ releasever-plus
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-6
# Contrib-packages by centos users
[Contrib]
Name = centos-$ releasever-contrib
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-6
Iii. Notes:
It is recommended that only one Yum source be valid when yum is used, because the network Yum source is used by default.
This article is from the "Resource Sharing" blog, please be sure to keep this source http://www1991.blog.51cto.com/8692352/1563304
Configuration and usage of local Yum source and network Yum source in centos 6.5