下面由centos基础教程栏目给大家介绍centos7 yum fastestmirror不能使用的解决办法,希望对需要的朋友有所帮助!
centos7 yum fastestmirror不能使用
[root@localhost ~]# yum install lrzsz Loaded plugins: fastestmirror Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
==================================================
第一步:
[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf [main] enabled=1//把1改为0 verbose=0 always_print_best_host = true socket_timeout=3 # Relative paths are relative to the cachedir (and so works for users as well # as root). hostfilepath=timedhosts.txt maxhostfileage=10 maxthreads=15 #exclude=.gov, facebook #include_only=.nl,.de,.uk,.ie
============================================
第二步:
[root@localhost ~]# vi /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1//将plugins的值修改为0 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # manually check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
=============================================
继续运行,出现如下错误
[root@localhost ~]# yum install lrzsz Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error" One of the configured repositories failed (Unknown), 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:
==============================================
原因:没有配置resolv.conf
解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
[root@localhost ~]# vi /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 search localdomain
保存再次运行命令就可以。
以上就是“centos7 yum fastestmirror不能使用怎么办”的详细内容,更多请关注1818ip网其它相关文章!
相关文章
标签:CentOS
- •centos中的uuid是必须的吗 centos安装minicom必须联网吗
- •centos如何查看用户 centos如何查看用户密码
- •centos重启后时间不对怎么办 centos时间不同步怎么解决
- •如何解决centos7下chrome打不开的问题 centos安装chrome
- •centos下ping不通网关怎么办 centos ping不通网关怎么解决
- •centos7系统找不到网卡 centos7装完系统找不到网卡
- •centos中pear命令无法使用怎么办 pear是什么意思
- •centos怎么实现开机进入命令行模式 centos7开机进入命令行模式
- •centos无法进入图形界面怎么解决 centos无法进入图形界面
- •centos默认用户名密码是什么 centos默认用户名密码