
报错已加载插件fastestmirrorDetermining fastest mirrorsCould not retrieve mirrorlist http://mirrorlist.centos.org/?release7archx86_64repoosinfrastock error was14: curl#6 - Could not resolve host: mirrorlist.centos.org; 未知的错误One of the configured repositories failed (未知),and yum doesnt have enough cached data to continue. At this point the onlysafe 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 workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablereporepoid ...4. Disable the repository permanently, so yum wont use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable repoidorsubscription-manager repos --disablerepoid5. 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 muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setoptrepoid.skip_if_unavailabletrueCannot find a valid baseurl for repo: base/7/x86_64测试是否是网络问题[rootmaster ]# ping www.baidu.com网络没有问题尝试更新yum[rootmaster ]# yum clean all报错解决方法[rootmaster ~]# vim /etc/yum.repos.d/CentOS-Base.repo修改内容以下文件为完整代码可以全部复制粘贴# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist does not work for you, as a fall back you can try the# remarked out baseurl line instead.##[base]nameCentOS-$releasever - Base#mirrorlisthttp://mirrorlist.centos.org/?release$releaseverarch$basearchrepoosinfra$infra#baseurlhttp://mirror.centos.org/centos/$releasever/os/$basearch/#baseurlhttp://vault.centos.org/7.9.2009/x86_64/os/baseurlhttp://vault.centos.org/7.9.2009/os/$basearch/gpgcheck1gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates[updates]nameCentOS-$releasever - Updates#mirrorlisthttp://mirrorlist.centos.org/?release$releaseverarch$basearchrepoupdatesinfra$infra#baseurlhttp://mirror.centos.org/centos/$releasever/updates/$basearch/#baseurlhttp://vault.centos.org/7.9.2009/x86_64/os/baseurlhttp://vault.centos.org/7.9.2009/updates/$basearch/gpgcheck1gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]nameCentOS-$releasever - Extras#mirrorlisthttp://mirrorlist.centos.org/?release$releaseverarch$basearchrepoextrasinfra$infra#$baseurlhttp://mirror.centos.org/centos/$releasever/extras/$basearch/#baseurlhttp://vault.centos.org/8.9.2009/x86_64/os/baseurlhttp://vault.centos.org/7.9.2009/extras/$basearch/gpgcheck1gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]nameCentOS-$releasever - Plus#mirrorlisthttp://mirrorlist.centos.org/?release$releaseverarch$basearchrepocentosplusinfra$infra#baseurlhttp://mirror.centos.org/centos/$releasever/centosplus/$basearch/#baseurlhttp://vault.centos.org/7.9.2009/x86_64/os/baseurlhttp://vault.centos.org/7.9.2009/centosplus/$basearch/gpgcheck1enabled0gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7继续执行[rootmaster ~]# cd /etc/yum.repos.d[rootmaster yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo[rootmaster ~]# yum clean all没有报错安装自己所需软件包[rootmaster ~]# yum install lsof成功