如果你想同时启用多个仓库,使用以下格式。这个命令将启用 epel、epel-testing 和 ius 仓库:
# yum-config-manager --enable epel epel-testing ius
对于 Fedora 系统,运行下面的命令来启用仓库:
# dnf config-manager --set-enabled epel-testing
如何在系统中禁用一个仓库
无论何时你在默认情况下添加一个新的仓库,它都会启用它们的稳定仓库,这就是为什么我们在运行 yum repolist 命令时获取了仓库信息。如果你不想使用仓库,那么可以通过下面的命令来禁用它。
为了验证这点,我们将要禁用 epel-testing.repo 和 ius.repo ,运行以下命令:
# yum-config-manager --disable epel-testing ius -
Loaded plugins: fastestmirror ==================================================================================== repo: epel-testing ===================================================================================== [epel-testing] bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/6 baseurl = cache = 0 cachedir = /var/cache/yum/x86_64/6/epel-testing cost = 1000 enabled = 0 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/6/epel-testing/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/6/epel-testing/gpgdir gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 hdrdir = /var/cache/yum/x86_64/6/epel-testing/headers http_caching = all includepkgs = keepalive = True mdpolicy = group:primary mediaid = metadata_expire = 21600 metalink = mirrorlist = https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=x86_64 mirrorlist_expire = 86400 name = Extra Packages for Enterprise Linux 6 - Testing - x86_64 old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/6/epel-testing pkgdir = /var/cache/yum/x86_64/6/epel-testing/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 username = -
========================================================================================= repo: ius ========================================================================================= [ius] bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/6 baseurl = cache = 0 cachedir = /var/cache/yum/x86_64/6/ius cost = 1000 enabled = 0 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/6/ius/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/6/ius/gpgdir gpgkey = file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY hdrdir = /var/cache/yum/x86_64/6/ius/headers http_caching = all includepkgs = keepalive = True mdpolicy = group:primary mediaid = metadata_expire = 21600 metalink = mirrorlist = https://mirrors.iuscommunity.org/mirrorlist?repo=ius-centos6&arch=x86_64&protocol=http mirrorlist_expire = 86400 name = IUS Community Packages for Enterprise Linux 6 - x86_64 old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/6/ius pkgdir = /var/cache/yum/x86_64/6/ius/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 username =
(编辑:ASP站长网)
|