How to modify CentOS yum source

  

Resolve slow downloading in CentOS yum source

There was recently installed CentOS 5.5 under the virtual machine. When using yum update, the download speed was abnormally slow. You can modify the yum configuration file and point it to the domestic server. Option 1: # cd /etc/yum.repos.d/# mv CentOS-Base.repo CentOS-Base.repo.bak# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo Second: means to modify the CentOS-Base.repo file, set the baseurl to baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/Detailed configuration is as follows:

[base ]

name=CentOS-5-Base

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os

#baseurl=http://mirror.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

#mirrorlist=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 releas Ed

[addons]

name=CentOS-5-Addons

#mirrorlist=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

#mirrorlist=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

#mirrorlist=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

#c Ontrib – packages by Centos Users

[contrib]

name=CentOS-5-Contrib

#mirrorlist=http://mirrorlist.centos.org/?release =4&arch=$basearch&repo=contrib

baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/

gpgcheck=1< Br>

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, test # yum update delete all temporary files

#yum clean all

Copyright © Windows knowledge All Rights Reserved