阿里各版本yum源如下:

  Centos5:http://mirrors.aliyun.com/repo/Centos-5.repo

  Centos6:http://mirrors.aliyun.com/repo/Centos-6.repo

  Centos7:http://mirrors.aliyun.com/repo/Centos-7.repo

操作分为2步

1)、备份原有的yum源,以防发生错误。

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

2)、下载阿里的yum源到/ect/yum.repos.d/下

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

之后运行了一把,yum clean all   。之后yum就报错了,无法安装任何东西,也无法连接网络,ping baidu.com 发现无法ping通 ,ifconfig  发现是dns出了问题。

修改dns :

vi /etc/resolv.conf

添加规则
nameserver 114.114.114.114

然后service network restart 重启网络服务

查看yum状态 yum repolist

生成缓存

yum makecache

可以正常yum了

将Centos 的默认yum源改为阿里云的yum源后出现的问题的更多相关文章

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

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

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

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

  3. 教你优化yum源。配置阿里云的yum镜像源(base和epel)

    一.Centos7的base源配置阿里云的yum源: 1.备份旧的yum源目录下的所有文件 [root@ELK-chaofeng07 yum.repos.d]# mkdir ../yum.repos. ...

  4. zabbix官方源替换为阿里云的zabbix源,一键脚本。(安装zabbix报错curl#18 - "transfer closed with 2988713 bytes remaining to read":15 ETA Trying other mirro)

    最近突然安装zabbix总是报错,比如 (24/27): t1lib-5.1.2-14.el7.x86_64.rpm | 166 kB 00:00:00 zabbix-web-4.4.6-1.el7. ...

  5. ubuntu16.04 LTS把下载源改为阿里云的源

    为什么要切换下载源到国内的源上? Ubuntu的中国服务器下载速度很慢,我们可以尝试修改软件更新源,这样下载和更新软件的速度会加快很多. 一.linux系统版本: ubuntukylin-16.04- ...

  6. 将centos的yum源修改为阿里云的yum源

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

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

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

  8. [转载]linux 更新yum源 改成阿里云源

    原文链接:https://www.cnblogs.com/bincoding/p/7892762.html 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc ...

  9. 更改CentOS 7更新源为国内阿里云提供的源

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

随机推荐

  1. 关于<asp:checkBoxList>控件的对齐方法

    定义和用法 TextAlign 属性用于获取或设置 CheckBoxList 项目的文本的文本对齐方式. 语法 <asp:CheckBoxList TextAlign="align&q ...

  2. 怎样在 fedora 28 上 打开 .jnlp 文件

    最近使用 iDrac 和 iLO 总是会使用到 .jnlp 文件, 为了方便,今天把设置过程记录下来. JNLP 文件,全名为 Java Network Launching Protocol 文件, ...

  3. history历史记录控制

    往往我们操作的每一条命令都会被机器记录下来,所有我们为了安全需要屏蔽掉某些敏感的操作命令. 设置linux默认的历史记录数: 临时生效: export  HISTSIZE=5 history 永久生效 ...

  4. Docker容器学习与分享05

    Docker镜像操作 学完了一些最基本的操作之后,我学习了一些关于docker镜像的基本操作. 首先来学习一下从docker hub上拉取镜像,以centos镜像为例,使用docker search命 ...

  5. sql注入--access

    access数据库结构: 表名  -->  列名  -->  数据 access注入攻击片段 联合查询法: (1)  判断注入点:  ?id=1 and 1=1 ; ?id=1 and 1 ...

  6. 在学习前端的路上,立下一个Flag

    今天开始百度前端学习,以此为证

  7. 使用JFreeChart实现基于Web的柱状图

    JFreeChart是一组功能强大.灵活易用的 Java绘图 API,使用它可以生成多种通用性的报表,包括柱状图.饼图.曲线图等.它能够用在 Swing和 Web等中制作自定义的图表或报表,并且得到广 ...

  8. mpvue使用vant Weapp运行npm run build命令打包后失效

    最近在使用mpvue开发微信小程序,在开发过程中使用有赞的小程序ui框架—— vant Weapp ,至于如何使用在我个人博客中有一篇关于如何使用vant Weapp ,需要的同学请点进这里自行查看. ...

  9. unset MAILCHECK

    文件/etc/profile尾部有: unset MAILCHECK 为了解决:每次登陆linux总是提示:you hava a new mail

  10. leetcode-856 Score of Parentheses

    Given a balanced parentheses string S, compute the score of the string based on the following rule: ...