1. Change Source
Well, for all the reasons, the download speed of many yum source paths provided by centos is very slow. So, change the source.
# cd /etc/yum.repos.d
# cp CentOS-Base.repo CentOS-Base.repo.backup# vim CentOS-Base.repo
Under normal circumstances, the CentOS-Base.repo file is used to obtain the Source Path listing and then download the source package, don't worry about him, delete these lines
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
Remove the following lines #
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
Then, replace pai.centos.org with the address of the domestic source server.
For example, change to Alibaba Source
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearchbaseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
There are some good source servers in China
Zhongke dayuan/
2. Build local ground source servers
It is immoral to download things when there are many people in the lab, so it is very troublesome to build a server to download things. However, no one was using the lab network at night, so I wanted to build a local ground source server to facilitate the quick update of my brother, sister, and younger siblings.
First download two software # Yum install createrepo httpd
Then start the HTTP server
# Service httpd start
# Chkconfig httpd on
Go to the HTTP directory
CD/var/www/html/
Mkdir centos
CD centos
Show source list
# Yum repolist
Usually base, update, extras, epel, etc.
Select a download, all download
# Reposync -- repoid = base
After the download is complete, several more folders will be displayed in the current folder. Modify the user group and permissions.
# Chown-r yourname: yourgroup/var/www/html/centos
# Chmod-r 755/var/www/html/centos
Use the following command to create a file library in each directory of centos
$ Createrepo/var/www/html/centos/base
After successful modification, you can modify the path in the. Repo file.
[base]
……
baseurl=http://localhost/centos/base
……
[update]
……
baseurl=http://localhost/centos/update
……
[extras]
……
baseurl=http://localhost/centos/extras
……
Replace the yum source and build the yum local ground source server in centos 6.5