修改CentOS的yum源,改成阿里云的镜像

修改办法来自阿里云官方网站 https://opsx.alibaba.com/mirror ,网站中有包括CentOS系统在内的多个linux版本的yum源以及相关帮助信息。linux

修改步骤:缓存

一、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

二、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5curl

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

或者网站

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6阿里云

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

或者url

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7spa

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者code

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

三、以后运行yum makecache生成缓存

相关文章
相关标签/搜索