Centos yum源找不到包及问题修复
Posted licbc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos yum源找不到包及问题修复相关的知识,希望对你有一定的参考价值。
yum install nginx 发现yum源无法使用,提示如下:
Loaded plugins: fastestmirror, langpacks
file:///mnt/vmtools/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/vmtools/repodata/repomd.xml"
Trying other mirror.
One of the configured repositories failed (bao),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable bao
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=bao.skip_if_unavailable=true
failure: repodata/repomd.xml from bao: [Errno 256] No more mirrors to try.
file:///mnt/vmtools/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/vmtools/repodata/repomd.xml"
根据建议采取第三条
[deployer@host-172-25-4-11 var]$ sudo yum-config-manager --disable bao
Loaded plugins: fastestmirror, langpacks
============================================= repo: bao ==============================================
[bao]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl = file:///mnt/vmtools
cache = 0
cachedir = /var/cache/yum/x86_64/7/bao
check_config_file_age = True
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 0
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/x86_64/7/bao/gpgcadir
gpgcakey =
gpgcheck = False
gpgdir = /var/lib/yum/repos/x86_64/7/bao/gpgdir
gpgkey =
hdrdir = /var/cache/yum/x86_64/7/bao/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = bao
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/bao
pkgdir = /var/cache/yum/x86_64/7/bao/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
ui_id = bao
ui_repoid_vars = releasever,
basearch
username =
问题解决
以上是关于Centos yum源找不到包及问题修复的主要内容,如果未能解决你的问题,请参考以下文章
CentOS yum 命令出现 [Errno 14] curl#6 - "Couldn't resolve host ..." 的解决方法(代码片段