Centos的yum源更换为国内的阿里云源

本文转自:https://www.cnblogs.com/zzsdream/p/7405083.htmlhtml

 

一、备份

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

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

 

CentOS 5

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

或者post

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

 

 

CentOS 6

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

或者htm

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

 

 

CentOS 7

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

或者class

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

 

说明:若是wget命令执行报错,说明可能没安装wget命令。执行cur便可

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

相关文章
相关标签/搜索