在 阿里巴巴镜像站页面,在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. 对于一般情况X1+X2+X3+……+Xn=m 的正整数解有 (m-1)C(n-1) 它的非负整数解有 (m+n-1)C(n-1)种

    对于一般情况X1+X2+X3+……+Xn=m 的正整数解有 (m-1)C(n-1) 它的非负整数解有 (m+n-1)C(n-1)种

  2. 清理maven缓存

    原文:https://blog.csdn.net/viplisong/article/details/82963989maven下载失败后会缓存文件,可能导致下次下载失败.通过以下两步清理 1.cd ...

  3. Uva10491 Cows and Cars 【迁移自洛谷博客】

    题目大意 假设有a头牛,b辆车(门的总数为a+b),你先选一个门,然后你最终选择前主持人会替你打开C扇有牛的门(不会打开你已经选择的门),问你要不要换门,输出"总是换门"的策略下, ...

  4. apache2 配置入门

    ServerRoot "/usr/local/apache2" #服务器根目录 Listen #监听端口 语法格式为Listen [IP地址:]端口 [协议],其中IP地址与协议为 ...

  5. 基于vue的移动端web音乐播放器

    声明 以下只是学习完慕课网huangyi老师实战视频课程的笔记内容,仅供个人参考学习使用.如果对Vue2.0实战高级-开发移动端音乐WebApp感兴趣的话,请移步这里:https://coding.i ...

  6. python的转义字符,以及字符串输出转义字符

    Python的转义字符及其含义     符    号     说     明       \'   单引号       \"   双引号       \a   发出系统响铃声       \ ...

  7. The Constructor with No Arguments

    If a class supplies at least one constructor but does not supply a no-argument constructor, it is il ...

  8. Python3解leetcode Binary Tree PathsAdd Digits

    问题描述: Given a non-negative integer num, repeatedly add all its digits until the result has only one ...

  9. 从头开始开发一个vue幻灯片组件

    首先新建项目vue init webpack projectName 安装依赖包npm i这些就不说了 接下来就是构建我们的swiper组件 因为我写的代码不规范, 通不过eslint的检测, 会频繁 ...

  10. 七、单例设计模式共享数据分析、解决、call_once

    一.设计模式大概谈 代码的一些写法,与常规的写法不太一样,程序灵活,维护起来很方便,但是别人接管.阅读代码很痛苦. 用设计模式理念写出来的代码很晦涩.<< head first>&g ...