[关闭]
@ruoli 2016-08-19T12:10:49.000000Z 字数 2051 阅读 1570

CentOS Yum不可用解决方法

Linux


重新添加163Yum源,具体步骤如下:

1、备份本地Yum源

  1. cd /etc/yum.repos.d
  2. mv local.repo local.repo.temp

2、添加163Yum源

将163Yum源添加至 /etc/yum.repos.d 目录,具体可见以下第三点,然后 运行如下代码即可:

  1. yum list

3、163 Yum源文件内容

保存如下内容至文件 CentOS6-Base.repo 即可

  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client. You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12. [base]
  13. name=CentOS-$releasever - Base - 163.com
  14. baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
  15. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  16. gpgcheck=1
  17. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  18. #released updates
  19. [updates]
  20. name=CentOS-$releasever - Updates - 163.com
  21. baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
  22. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  23. gpgcheck=1
  24. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-$releasever - Extras - 163.com
  28. baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
  29. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  30. gpgcheck=1
  31. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-$releasever - Plus - 163.com
  35. baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
  36. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  40. #contrib - packages by Centos Users
  41. [contrib]
  42. name=CentOS-$releasever - Contrib - 163.com
  43. baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
  44. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注