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:
Means to modify the CentOS-Base.repo file, set baseurlBaseurl = http://ftp.sjtu.edu.cn/centos/5/addons/?basearch/
The detailed configuration is as follows:
[ Base ]
Name = Centos- 5 -Base
# Shortlist = 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
# Shortlist = 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
# Shortlist = 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
# Shortlist = 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
# Shortlist = 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
# Shortlist = 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
ImportKey
#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