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了

  • 相关阅读:
    进程、线程
    timer控件、三级联动
    用户控件、动态创建添加
    打印控件
    窗体移动和阴影,对话框控件
    winform listview控件
    winform打开唯一窗体、构造函数传值
    菜单和工具栏
    winform公共控件
    hibernate中各种包的添加
  • 原文地址:https://www.cnblogs.com/hyblogs/p/10435185.html
Copyright © 2011-2022 走看看