Configuration and use of Yum Update source in CentOS
1 "Go to yum Directory
[[Email protected] ~] #cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo
Here you can see that Centos-base.repo is currently used in the Yum configuration file, in general we can also directly vim to modify the inside, but this method is seldom used, directly change the new repo file on it.
"2" Backup Centos-base.repo
[email protected] yum.repos.d]# CP Centos-base.repo Centos-base.repo.ori #可使用mv
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-debuginfo.repo Centos-vault.repo
Centos-base.repo.ori Centos-media.repo
You can also use the MV command to make a backup, but there will be no Centos-base.repo file and only the Centos-base.repo.ori file, where the purpose of the backup before the modification
1. There is a problem rolling back
2. Later than the content of the changed
"3" Download the new repo file from the 163 mirror site
[Email protected] yum.repos.d]# wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2015-05-2015:14:31--Http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolvingmirrors.163.com ... 123.58.173.186, 123.58.173.185
Connecting tomirrors.163.com|123.58.173.186|:80 ... Connected.
HTTP requestsent, awaiting response ... OK
length:2006 (2.0K) [Application/octet-stream]
Saving To:acentos6-base-163.repoa
100%[======================================>]2,006--.-k/s in 0s
2015-05-2015:14:31 (123 MB/s)-Acentos6-base-163.repoa saved[2006/2006]
[[email protected] yum.repos.d]# ls
Centos6-base-163.repo Centos-base.repo.ori Centos-media.repo
Centos-base.repo Centos-debuginfo.repo Centos-vault.repo
You can see that there are more Centos6-base-163.repo files at this time. This is the repo file that was downloaded from the 163 mirror site.
"4" Changes the newly downloaded repo file to the Yum profile currently in use
1
2
[email protected] yum.repos.d]# CP Centos6-base-163.repo Centos-base.repo
Cp:overwrite ' Centos-base.repo '? Y
The update source for Yum is now successfully configured.
You can also go to configuration file to view
[Email protected] yum.repos.d]# vim Centos-base.repo
This article is from the "Mr Guo" blog, so be sure to keep this source http://490617581.blog.51cto.com/7223113/1751116
Configuration and use of Yum Update source in CentOS