搜索
 找回密码
 立即注册

CentOS更换yum源。

abcys 2024-8-2 18:30:02 154
wget安装失败!CentOS更换yum源。

1、连接 “Linux系统” 服务器


连接 “CentOS系统” 服务器教程:点击查看

2、文件


找到:/etc/yum.repos.d/CentOS-Base.repo

3、替换


把 “CentOS-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 - mirrors.aliyun.com
  14. failovermethod=priority
  15. baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
  16.         http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
  17.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
  18. gpgcheck=1
  19. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

  20. #released updates
  21. [updates]
  22. name=CentOS-$releasever - Updates - mirrors.aliyun.com
  23. failovermethod=priority
  24. baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
  25.         http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
  26.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
  27. gpgcheck=1
  28. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

  29. #additional packages that may be useful
  30. [extras]
  31. name=CentOS-$releasever - Extras - mirrors.aliyun.com
  32. failovermethod=priority
  33. baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
  34.         http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
  35.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
  36. gpgcheck=1
  37. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

  38. #additional packages that extend functionality of existing packages
  39. [centosplus]
  40. name=CentOS-$releasever - Plus - mirrors.aliyun.com
  41. failovermethod=priority
  42. baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
  43.         http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  44.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

  48. #contrib - packages by Centos Users
  49. [contrib]
  50. name=CentOS-$releasever - Contrib - mirrors.aliyun.com
  51. failovermethod=priority
  52. baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
  53.         http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
  54.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
  55. gpgcheck=1
  56. enabled=0
  57. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
复制代码
随机推荐

0 回复

高级模式
游客