How CentOS sets update source

  
 

Ali's server basically uses RedHat and CentOS. My work in Ali is going to start from this one~1, enter the update source directory cd /etc/yum.repos.d

2, backup The original CentOS-Base.repo file mv CentOS-Base.repo CentOS-Base.repo.bak

3, create a new CentOS-Base.repo file vi CentOS-Base.repo

The contents of the file are as follows (take CentOS 5.9 as an example): # CentOS-Base.repo## This file uses a new mirrorlist system developed by Lance Davis for CentOS.# The mirror system uses the connecting IP address of the client and the# update status Of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back You can try the # remarked out baseurl= line instead.##

[base]name=CentOS-$releasever - Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever& Arch=$basearch&repo=osbaseurl=http://centos.ustc.edu.cn/centos /$releasever/os/$basearch/gpgcheck=1gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#released updates[updates]name= CentOS-$releasever - Updates#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesbaseurl=http://centos.ustc.edu.cn/centos/$releasever /updates/$basearch/gpgcheck=1gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released [addons]name=CentOS-$releasever - Addons#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addonsbaseurl=http://centos.ustc.edu.cn /centos/$releasever/addons/$basearch/gpgcheck=1gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be Useful[extras]name=CentOS-$releasever - Extras#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasbaseurl=http://centos.ustc.edu. Cn/centos/$releasever/extras/$basearch/gpgcheck=1gp Gkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusbaseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch /gpgcheck=1enabled=0gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

4, save and exit. Whether the test is valid by yum update.
zh-CN"],null,[0.96969694],zh-CN"]]]

Copyright © Windows knowledge All Rights Reserved