zoukankan      html  css  js  c++  java
  • 将Centos 的默认yum源改为阿里云的yum源后出现的问题

    阿里各版本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了

  • 相关阅读:
    Log4j学习
    HttpURLConnection请求
    正则表达式验证中文、图片上传
    freemarker学习
    参数中带有“&”符号问题
    禁止打印页面
    myEclipse 界面窗口打不开问题
    屏蔽网页右键
    分享功能
    table表格某一td内容太多导致样式混乱的解决方案
  • 原文地址:https://www.cnblogs.com/hyblogs/p/10435185.html
Copyright © 2011-2022 走看看