CentOS-Stream-9 CentOS9 设置国内yum源-阿里云源

打印 上一主题 下一主题

主题 825|帖子 825|积分 2475


yum设置文件路径

centos.repo

centos.repo 设置文件是 CentOS 系统中用于设置 yum 软件仓库(repository)的文件。这个文件界说了 yum 从哪些 URL 地点获取软件包。
/etc/yum.repos.d/centos.repo
centos-addons.repo

centos-addons.repo 设置文件是 CentOS 系统中用于设置额外软件仓库(repository)的 yum 设置文件。这个文件允许用户添加除了基础仓库之外的额外软件包源,以便安装那些不在基础仓库中的软件包。
/etc/yum.repos.d/centos-addons.repo
备份设置文件

  1. cp /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup-20240812-1
  2. cp /etc/yum.repos.d/centos-addons.repo /etc/yum.repos.d/centos-addons.repo.backup-20240812-1
  3. ll
复制代码
  1. 总用量 44
  2. -rw-r--r--. 1 root root 4245  4月  6  2023 centos-addons.repo
  3. -rw-r--r--  1 root root 4245  8月 12 11:52 centos-addons.repo.backup-20240812-1
  4. -rw-r--r--. 1 root root 2600  4月  6  2023 centos.repo
  5. -rw-r--r--  1 root root 2600  8月 12 11:52 centos.repo.backup-20240812-1
  6. -rw-r--r--. 1 root root 1919  7月  3 11:26 docker-ce.repo
  7. -rw-r--r--. 1 root root 1519 12月  2  2021 epel-next.repo
  8. -rw-r--r--. 1 root root 1621 12月  2  2021 epel-next-testing.repo
  9. -rw-r--r--. 1 root root 1453 12月  2  2021 epel.repo
  10. -rw-r--r--. 1 root root 1552 12月  2  2021 epel-testing.repo
复制代码
修改yum源

centos.repo

  1. [baseos]
  2. name=CentOS Stream $releasever - BaseOS
  3. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/
  4. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  5. gpgcheck=1
  6. repo_gpgcheck=0
  7. metadata_expire=6h
  8. countme=1
  9. enabled=1
  10. [baseos-debug]
  11. name=CentOS Stream $releasever - BaseOS - Debug
  12. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/debug/tree/
  13. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  14. gpgcheck=1
  15. repo_gpgcheck=0
  16. metadata_expire=6h
  17. enabled=0
  18. [baseos-source]
  19. name=CentOS Stream $releasever - BaseOS - Source
  20. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/source/tree/
  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  22. gpgcheck=1
  23. repo_gpgcheck=0
  24. metadata_expire=6h
  25. enabled=0
  26. [appstream]
  27. name=CentOS Stream $releasever - AppStream
  28. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/os/
  29. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  30. gpgcheck=1
  31. repo_gpgcheck=0
  32. metadata_expire=6h
  33. countme=1
  34. enabled=1
  35. [appstream-debug]
  36. name=CentOS Stream $releasever - AppStream - Debug
  37. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/debug/tree/
  38. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  39. gpgcheck=1
  40. repo_gpgcheck=0
  41. metadata_expire=6h
  42. enabled=0
  43. [appstream-source]
  44. name=CentOS Stream $releasever - AppStream - Source
  45. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/debug/tree/
  46. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  47. gpgcheck=1
  48. repo_gpgcheck=0
  49. metadata_expire=6h
  50. enabled=0
  51. [crb]
  52. name=CentOS Stream $releasever - CRB
  53. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/$basearch/os/
  54. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  55. gpgcheck=1
  56. repo_gpgcheck=0
  57. metadata_expire=6h
  58. countme=1
  59. enabled=0
  60. [crb-debug]
  61. name=CentOS Stream $releasever - CRB - Debug
  62. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/$basearch/debug/tree/
  63. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  64. gpgcheck=1
  65. repo_gpgcheck=0
  66. metadata_expire=6h
  67. enabled=0
  68. [crb-source]
  69. name=CentOS Stream $releasever - CRB - Source
  70. baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/source/tree/
  71. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  72. gpgcheck=1
  73. repo_gpgcheck=0
  74. metadata_expire=6h
  75. enabled=0
复制代码
centos-addons.repo

  1. [highavailability]
  2. name=CentOS Stream $releasever - HighAvailability
  3. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/$basearch/os/
  4. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  5. gpgcheck=1
  6. repo_gpgcheck=0
  7. metadata_expire=6h
  8. countme=1
  9. enabled=0
  10. [highavailability-debug]
  11. name=CentOS Stream $releasever - HighAvailability - Debug
  12. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/$basearch/debug/tree/
  13. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  14. gpgcheck=1
  15. repo_gpgcheck=0
  16. metadata_expire=6h
  17. enabled=0
  18. [highavailability-source]
  19. name=CentOS Stream $releasever - HighAvailability - Source
  20. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/source/tree/
  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  22. gpgcheck=1
  23. repo_gpgcheck=0
  24. metadata_expire=6h
  25. enabled=0
  26. [nfv]
  27. name=CentOS Stream $releasever - NFV
  28. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/$basearch/os/
  29. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  30. gpgcheck=1
  31. repo_gpgcheck=0
  32. metadata_expire=6h
  33. countme=1
  34. enabled=0
  35. [nfv-debug]
  36. name=CentOS Stream $releasever - NFV - Debug
  37. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/$basearch/debug/tree/
  38. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  39. gpgcheck=1
  40. repo_gpgcheck=0
  41. metadata_expire=6h
  42. enabled=0
  43. [nfv-source]
  44. name=CentOS Stream $releasever - NFV - Source
  45. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/source/tree/
  46. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  47. gpgcheck=1
  48. repo_gpgcheck=0
  49. metadata_expire=6h
  50. enabled=0
  51. [rt]
  52. name=CentOS Stream $releasever - RT
  53. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/$basearch/os/
  54. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  55. gpgcheck=1
  56. repo_gpgcheck=0
  57. metadata_expire=6h
  58. countme=1
  59. enabled=0
  60. [rt-debug]
  61. name=CentOS Stream $releasever - RT - Debug
  62. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/$basearch/debug/tree/
  63. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  64. gpgcheck=1
  65. repo_gpgcheck=0
  66. metadata_expire=6h
  67. enabled=0
  68. [rt-source]
  69. name=CentOS Stream $releasever - RT - Source
  70. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/source/tree/
  71. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  72. gpgcheck=1
  73. repo_gpgcheck=0
  74. metadata_expire=6h
  75. enabled=0
  76. [resilientstorage]
  77. name=CentOS Stream $releasever - ResilientStorage
  78. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/$basearch/os/
  79. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  80. gpgcheck=1
  81. repo_gpgcheck=0
  82. metadata_expire=6h
  83. countme=1
  84. enabled=0
  85. [resilientstorage-debug]
  86. name=CentOS Stream $releasever - ResilientStorage - Debug
  87. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/$basearch/debug/tree/
  88. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  89. gpgcheck=1
  90. repo_gpgcheck=0
  91. metadata_expire=6h
  92. enabled=0
  93. [resilientstorage-source]
  94. name=CentOS Stream $releasever - ResilientStorage - Source
  95. baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/source/tree/
  96. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
  97. gpgcheck=1
  98. repo_gpgcheck=0
  99. metadata_expire=6h
  100. enabled=0
  101. [extras-common]
  102. name=CentOS Stream $releasever - Extras packages
  103. baseurl=http://mirrors.aliyun.com/centos-stream/SIGs/$stream/extras/$basearch/extras-common/
  104. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
  105. gpgcheck=1
  106. repo_gpgcheck=0
  107. metadata_expire=6h
  108. countme=1
  109. enabled=1
  110. [extras-common-source]
  111. name=CentOS Stream $releasever - Extras packages - Source
  112. baseurl=http://mirrors.aliyun.com/centos-stream/SIGs/$stream/extras/source/extras-common/
  113. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
  114. gpgcheck=1
  115. repo_gpgcheck=0
  116. metadata_expire=6h
  117. enabled=0
复制代码
更新缓存
   yum makecache
  1. [root@localhost yum.repos.d]# yum makecache
  2. CentOS Stream 9 - BaseOS                                                        451 kB/s | 9.2 MB     00:20   
  3. CentOS Stream 9 - AppStream                                                     468 kB/s |  18 MB     00:39   
  4. CentOS Stream 9 - Extras packages                                               39 kB/s |  18 kB     00:00   
  5. Docker CE Stable - aarch64                                                      8.5 kB/s | 3.5 kB     00:00   
  6. Extra Packages for Enterprise Linux 9 - aarch64                                 3.6 kB/s | 6.2 kB     00:01   
  7. Extra Packages for Enterprise Linux 9 - Next - aarch64                          8.4 kB/s |  17 kB     00:01   
复制代码
元数据缓存已建立。
   yum update
  ​

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

羊蹓狼

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表