[root@cloudtest]#yumlist已加载插件:fastestmirror/centos/7/os/x86_64/repodata/repomd.xml:[Errno14]curl#6-"Couldnotresolvehost:;未知的错误"正在尝试其它镜像。Oneoftheconfiguredrepositoriesfailed(CentOS-7-Base-),andyumdoesn'thaveenoughcacheddatatocontinue.Atthispointtheonlysafethingyumcandoisfail.Thereareafewwaystowork"fix"this:1.Contacttheupstreamfortherepositoryandgetthemtofixtheproblem.2.Reconfigurethebaseurl/etc.fortherepository,topointtoaworkingupstream.Thisismostoftenusefulifyouareusinganewerdistributionreleasethanissupportedbytherepository(andthepackagesforthepreviousdistributionreleasestillwork).3.Runthecommandwiththerepositorytemporarilydisabledyum--disablerepo=base...4.Disabletherepositorypermanently,soyumwon'tuseitbydefault.Yumwillthenjustignoretherepositoryuntilyoupermanentlyenableitagainoruse--enablerepofortemporaryusage:yum-config-manager--disablebaseorsubscription-managerrepos--disable=base5.Configurethefailingrepositorytobeskipped,ifitisunavailable.Notethatyumwilltrytocontacttherepo.whenitrunsmostcommands,sowillhavetotryandfaileachtime(andthus.yumwillbebemuchslower).Ifitisaverytemporaryproblemthough,thisisoftenanicecompromise:yum-config-manager--save--setopt=base.skip_if_unavailable=truefailure:repodata/repomd.xmlfrombase:[Errno256]Nomoremirrorstotry.
如果使用 yum list 或者安装某文件时提示这种报错,host 解析有问题,请检查网络 DNS 设置,重启网络服务,OK