报错信息:
已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile....
改了许多地方
修改/etc/yum.repos.d/CenOS-Base.repo文件内容(会显示新的错误,我又改回去了)
CentOS 7报错:yum命令报错 “ Cannot find a valid baseurl for repo: base/7/x86_6 ”_wy20210818的博客-CSDN博客_centos yum 报错https://blog.csdn.net/wy20210818/article/details/119885934?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.pc_relevant_aa&spm=1001.2101.3001.4242.1&utm_relevant_index=2照着上面的文章的改了一个遍都不行,我的DNS没问题也能上网,但依旧报错,还试了好多好多种方法都不行,又看到把CentOS-Base.repo加后缀使这个文件无效,然后再yum安装
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
结果又显示下面的错误:
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; " One of the configured repositories failed 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. Run the command with the repository temporarily disabled yum --disablerepo=... 4. Disable the repository permanently, 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 or subscription-manager repos --disable= 5. 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= .skip_if_unavailable=true Cannot find a valid baseurl for repo: base/7/x86_64
我又找到了使用yum clean all的方法就用了,结果还是不行,又看到有博主说这是个坑又找解决办法
yum clean all大坑解决 - Andy-Law - 博客园 (cnblogs.com)https://www.cnblogs.com/linuxandy/p/11367459.html然后执行yum list依然报错,证明etc/yum.repos.d/*.repo 这有问题,又找办法解决,
安装gcc出错,解决/etc/yum.repos.d/*.repo文件不可用问题_湮没人世间的博客-CSDN博客https://blog.csdn.net/u013835877/article/details/39549427/看到这篇文章使用他的解决方法,还是把CentOS-Base.repo改名字,又重新下载新的文件但我用他的命令下载报错,又找了别的命令下载repo文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS7更换镜像下载源_黯然神伤888的博客-CSDN博客https://blog.csdn.net/dante1987/article/details/114134236?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&utm_relevant_index=2然后运行了的下面步骤
yum clean all #清除缓存 yum makecache #生成缓存 yum -y update #更新
更新完要等待一段时间出现“完毕!”就好了,然后就可以正常yum -y install telnet啦



