一、更新yum源
步骤:
a.更新/etc/yum.repos.d目录下CentOS-Base.repo文件**
b. 使用yum makecache更新仓库的配置信息。
1、更新/etc/yum.repos.d目录下的CentOs-Base.repo文件
1)进入/etc/yum.repos.d目录下,备份CentOS-Base.repo文件
命令:# mv CentOS-Base.repo CentOS-Base.repo.backup
、
2)将新的CentOS-Base.repo文件复制当到当前目录当中(我是用的xshell,可以直接拖进去;其他工具亦然)
CentOS-Base.repo文件地址:http://pan.baidu.com/s/1mhJbcXq
2、yum makecache更新仓库的配置信息
# yum makecache
OK,这样就完后才能了yum源的更新。
当然还要另外一种方式,但是我没有试过,如果这种失败,可以尝试一下。
附:文件信息:
# CentOS-Base.repo
#
# 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 - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/ releasever/os/ basearch/
http://mirrors.aliyuncs.com/centos/ releasever/os/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/ releasever/updates/ basearch/
http://mirrors.aliyuncs.com/centos/ releasever/updates/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/ releasever/extras/ basearch/
http://mirrors.aliyuncs.com/centos/ releasever/extras/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/ releasever/centosplus/ basearch/
http://mirrors.aliyuncs.com/centos/ releasever/centosplus/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/ releasever/contrib/ basearch/
http://mirrors.aliyuncs.com/centos/ releasever/contrib/ basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
本文介绍了如何将CentOS 6.8系统的yum源更新为阿里云源,包括修改CentOs-Base.repo文件并使用yum makecache更新仓库配置。提供了详细的步骤和阿里云源的配置文件内容。
237

被折叠的 条评论
为什么被折叠?



