加入收藏 | 设为首页 | 会员中心 | 我要投稿 晋中站长网 (https://www.0354zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

如何在CentOS中添加、启用和禁用一个仓库

发布时间:2018-11-22 21:32:28 所属栏目:Windows 来源:Prakash Subramanian
导读:在基于 RPM 的系统上,例如 RHEL、CentOS 等,我们中的许多人使用 yum 包管理器来管理软件的安装、删除、更新、搜索等。 Linux 发行版的大部分软件都来自发行版官方仓库。官方仓库包含大量免费和开源的应用和软件。它很容易安装和使用。 由于一些限制和专

如果你想同时启用多个仓库,使用以下格式。这个命令将启用 epel、epel-testing 和 ius 仓库:

  1. # yum-config-manager --enable epel epel-testing ius

对于 Fedora 系统,运行下面的命令来启用仓库:

  1. # dnf config-manager --set-enabled epel-testing

如何在系统中禁用一个仓库

无论何时你在默认情况下添加一个新的仓库,它都会启用它们的稳定仓库,这就是为什么我们在运行 yum repolist 命令时获取了仓库信息。如果你不想使用仓库,那么可以通过下面的命令来禁用它。

为了验证这点,我们将要禁用 epel-testing.repoius.repo,运行以下命令:

  1. # yum-config-manager --disable epel-testing ius
  2.  
  3. Loaded plugins: fastestmirror
  4. ==================================================================================== repo: epel-testing =====================================================================================
  5. [epel-testing]
  6. bandwidth = 0
  7. base_persistdir = /var/lib/yum/repos/x86_64/6
  8. baseurl =
  9. cache = 0
  10. cachedir = /var/cache/yum/x86_64/6/epel-testing
  11. cost = 1000
  12. enabled = 0
  13. enablegroups = True
  14. exclude =
  15. failovermethod = priority
  16. ftp_disable_epsv = False
  17. gpgcadir = /var/lib/yum/repos/x86_64/6/epel-testing/gpgcadir
  18. gpgcakey =
  19. gpgcheck = True
  20. gpgdir = /var/lib/yum/repos/x86_64/6/epel-testing/gpgdir
  21. gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  22. hdrdir = /var/cache/yum/x86_64/6/epel-testing/headers
  23. http_caching = all
  24. includepkgs =
  25. keepalive = True
  26. mdpolicy = group:primary
  27. mediaid =
  28. metadata_expire = 21600
  29. metalink =
  30. mirrorlist = https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=x86_64
  31. mirrorlist_expire = 86400
  32. name = Extra Packages for Enterprise Linux 6 - Testing - x86_64
  33. old_base_cache_dir =
  34. password =
  35. persistdir = /var/lib/yum/repos/x86_64/6/epel-testing
  36. pkgdir = /var/cache/yum/x86_64/6/epel-testing/packages
  37. proxy = False
  38. proxy_dict =
  39. proxy_password =
  40. proxy_username =
  41. repo_gpgcheck = False
  42. retries = 10
  43. skip_if_unavailable = False
  44. ssl_check_cert_permissions = True
  45. sslcacert =
  46. sslclientcert =
  47. sslclientkey =
  48. sslverify = True
  49. throttle = 0
  50. timeout = 30.0
  51. username =
  52.  
  53. ========================================================================================= repo: ius =========================================================================================
  54. [ius]
  55. bandwidth = 0
  56. base_persistdir = /var/lib/yum/repos/x86_64/6
  57. baseurl =
  58. cache = 0
  59. cachedir = /var/cache/yum/x86_64/6/ius
  60. cost = 1000
  61. enabled = 0
  62. enablegroups = True
  63. exclude =
  64. failovermethod = priority
  65. ftp_disable_epsv = False
  66. gpgcadir = /var/lib/yum/repos/x86_64/6/ius/gpgcadir
  67. gpgcakey =
  68. gpgcheck = True
  69. gpgdir = /var/lib/yum/repos/x86_64/6/ius/gpgdir
  70. gpgkey = file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
  71. hdrdir = /var/cache/yum/x86_64/6/ius/headers
  72. http_caching = all
  73. includepkgs =
  74. keepalive = True
  75. mdpolicy = group:primary
  76. mediaid =
  77. metadata_expire = 21600
  78. metalink =
  79. mirrorlist = https://mirrors.iuscommunity.org/mirrorlist?repo=ius-centos6&arch=x86_64&protocol=http
  80. mirrorlist_expire = 86400
  81. name = IUS Community Packages for Enterprise Linux 6 - x86_64
  82. old_base_cache_dir =
  83. password =
  84. persistdir = /var/lib/yum/repos/x86_64/6/ius
  85. pkgdir = /var/cache/yum/x86_64/6/ius/packages
  86. proxy = False
  87. proxy_dict =
  88. proxy_password =
  89. proxy_username =
  90. repo_gpgcheck = False
  91. retries = 10
  92. skip_if_unavailable = False
  93. ssl_check_cert_permissions = True
  94. sslcacert =
  95. sslclientcert =
  96. sslclientkey =
  97. sslverify = True
  98. throttle = 0
  99. timeout = 30.0
  100. username =

(编辑:晋中站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读