在 阿里巴巴镜像站页面,在centos 操作的帮助,有介绍 wgetcurl 2种方式来下载CentOS-Base.repo

  1. 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  1. 下载新的CentOS-Base.repo 到/etc/yum.repos.d/

2.1. CentOS-Base.repo 在阿里巴巴镜像站的链接

CentOS 5: http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6: http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7: http://mirrors.aliyun.com/repo/Centos-7.repo

使用 wget 软件进行下载

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

或者使用 curl 软件进行下载

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

或者直接下载 对应版本的CentOS-Base.repo文件,在本地使用编辑器打开,将本地打开的CentOS-Base.repo文件所有内容都复制到 centos的/etc/yum.repos.d/CentOS-Base.repo文件中去

  1. 运行 yum makecache 命令生成缓存
References
  1. 阿里巴巴镜像站页面 点击列表的centos行的操作列,点击"帮助" 就会弹出设置教程咧

Centos yum的源 设置为阿里云源的更多相关文章

  1. 更改CentOS 6.3 yum源为国内 阿里云源

    将CentOS的 yum源 更换为 阿里云源 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.b ...

  2. centos下将系统预置yum源更换为阿里云源

    参考:http://mirrors.aliyun.com/help/centos?spm=5176.bbsr150321.0.0.d6ykiD 步骤1:备份/etc/yum.repos.d/下的Cen ...

  3. Centos将yum源设置为阿里云的镜像源

    第一步:备份原有镜像源 mv /etc/yum.repo.d/Centos-Base.repo /etc/yum.repo.d/Centos-Base.repo.bak 第二步:下载阿里云的镜像源 w ...

  4. 将Centos的yum源更换为阿里云源

    阿里云Linux安装软件镜像源 阿里云是最近新出的一个镜像源.得益与阿里云的高速发展,这么大的需求,肯定会推出自己的镜像源.阿里云Linux安装镜像源地址:http://mirrors.aliyun. ...

  5. Linux将yum源设置为阿里云的镜像源

    第一步:备份原有镜像源 mv /etc/yum.repo.d/Centos-Base.repo /etc/yum.repo.d/Centos-Base.repo.bak 第二步:下载阿里云的镜像源 w ...

  6. 设置centos7.3的YUM源为国内阿里云源

     CentOS系统更换软件安装源 第一步:备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cent ...

  7. Centos修改镜像为国内的阿里云源或者163源等国内源

    阿里安装软件镜像源 阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ 第一步:备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repos.d/Ce ...

  8. Centos的yum源更换为阿里云源

    1.备份 # mv /etc/yum.repos.d/CentOS-Base.repo # /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载新的CentOS- ...

  9. linux 更新yum源 改成阿里云源

    1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载新的CentOS-Base ...

随机推荐

  1. MySQL系列之二四种隔离级别及加锁

    事务 1.定义:所有操作必须成功完成,否则在每个操作中所作的所有更改都会备撤销. 2.事务的ACID 原子性atomicity   一致性consistency   隔离性isolation   持续 ...

  2. python 的set定义

    set是集合,跟数学中的集合一样不能重复没有顺序 set定义有两种方式 1. b=set([1, 2, 3, 4]) 2. a={"} 输出: b=set([1, 2, 3, 4])a={1 ...

  3. 聊聊Dubbo - Dubbo可扩展机制实战

    1. Dubbo的扩展机制 在Dubbo的官网上,Dubbo描述自己是一个高性能的RPC框架.今天我想聊聊Dubbo的另一个很棒的特性, 就是它的可扩展性. 如同罗马不是一天建成的,任何系统都一定是从 ...

  4. php strip_tags()函数 语法

    php strip_tags()函数 语法 作用:剥去字符串中的 HTML 标签 语法:strip_tags(string,allow) 参数: 参数 描述 string  必须,规定要检查的字符串. ...

  5. Java总结第二期

    大家好,我又来了!!啦啦,我知道你们很想我,很想我赶快写更多的文章来提高自己的水平,好吧,我就从了你们.下面跟我一起来光顾Java第二期,掌声,掌声!!! 第二章: 这章,我要给大家讲得内容有变量,常 ...

  6. c#一些操作

    C# FileStream 按大小分段读取文本内容 using System.IO; namespace FileStreamRead { class Program { static void Ma ...

  7. C#后台获取post参数

    public static string GetQueryString(string key) { if (HttpContext.Current.Request[key] == null) retu ...

  8. vue绑定属性、绑定class及绑定style

    1.绑定属性  v-bind 或者 : 例如:<img :src="pic_src" /> <template> <div id="app& ...

  9. Linux ftp安装

    ftp安装部分,操作步骤如下: 可以使用yum命令直接安装ftp # yum install vsftpd ftp服务的开启与关闭命令: 开启:# /bin/systemctl start vsftp ...

  10. 1.OpenCV数据类型

    基础类型 1.模板类cv::Vec<> 固定向量类,维度已知的小型向量——处理效率高 2.cv::Point类(Point2i,Point2f,Point2d;Point3i,Point3 ...