Solution to slow download from centos Yum Source
Centos 5.5 has been installed under the virtual machine recently. When yum is used, it is found that the download speed is abnormal and slow. You can modify the yum configuration file and direct its image to a domestic server.
Solution 1:
# Cd/etc/yum. Repos. d/
# Mv CentOS-Base.repo CentOS-Base.repo.bak
# Wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
Solution 2:
Modify the CentOS-Base.repo file and set the baseurl to baseurl = http://ftp.sjtu.edu.cn/centos/5/addons/#basearch/
The detailed configuration is as follows:
[Base]
Name = 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/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Released updates
[Update]
Name = CentOS-5-Updates
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = updates
Baseurl = http://ftp.sjtu.edu.cn/centos/5/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Packages used/produced in the build but not released
[Addons]
Name = CentOS-5-Addons
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = Addons
Baseurl = http://ftp.sjtu.edu.cn/centos/5/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/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = CentOS-5-Plus
# Items list = http://mirrorlist.centos.org /? Release = 4 & arch = $ basearch & repo = centosplus
Baseurl = http://ftp.sjtu.edu.cn/centos/5/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/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
Import key
# Rpm-import http://ftp.sjtu.edu.cn/centos/5/ OS /i386/RPM-GPG-KEY-CentOS-5
Run and Test
# Yum update
Delete all temporary files
# Yum clean all
Address: http://www.cnblogs.com/codebean/archive/2011/05/27/2059900.html