阿里狼 发表于 2019-4-17 15:53:52

centos6修改yum源的方法

  原链接为:http://www.xqtesting.com/blog/linux-yum-399.html
  个别同学在yum安装软件的时候提示找不到源地址无法执行成功。一般是由于自己网络本身限制导致,解决方法为修改yum源为国内的。
  #备份当前的yum源
  mv /etc/yum.repos.d /etc/yum.repos.d.backup4comex
  #新建空的yum源设置目录
  mkdir /etc/yum.repos.d
  #下载阿里云的yum源配置
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  #重建缓存
  yum clean all
  yum makecache
  可能遇到的问题:执行报错“-bash: wget: command not found”
  #回滚配置
  cp /etc/yum.repos.d.backup4comex/* /etc/yum.repos.d
  #安装wget
  yum install wget -y
  rm -rf /etc/yum.repos.d
  mkdir /etc/yum.repos.d
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

页: [1]
查看完整版本: centos6修改yum源的方法