php毕业设计二手网站怎么做,口碑最好的购物网站平台,网站免费观看,购物网站的英文文章目录 背景解决方法 背景
今天在一台新服务器上安装nginx#xff0c;在这个过程中需要安装相关依赖#xff0c;在使用yum install命令时#xff0c;发生了以下报错内容#xff1a;
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release7archx8… 文章目录 背景解决方法 背景
今天在一台新服务器上安装nginx在这个过程中需要安装相关依赖在使用yum install命令时发生了以下报错内容
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release7archx86_64repoosinfrastock error was
14: 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通过查看这个报错日志关键在第一句Could not retrieve mirrorlist http://mirrorlist.centos.org无法访问该链接。
具体原因mirrorlist.centos.org 不再被支持。
解决方法
使用sed命令批量替换CentOS镜像源。具体如下
sudo sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sudo sed -i s/^#.*baseurlhttp/baseurlhttps/g /etc/yum.repos.d/*.repo
sudo sed -i s/^mirrorlisthttp/#mirrorlisthttps/g /etc/yum.repos.d/*.repo搞定。