Could not resolve host: mirrorlist.centos.org

yum安装软件的时候提示这个

复制代码
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile


 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=<repoid> ...

     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 <repoid>
        or
            subscription-manager repos --disable=<repoid>

     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=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: centos-openstack-train

主要是这个

复制代码
Could not resolve host: mirrorlist.centos.org

解决:

复制代码
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-OpenStack-train.repo
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-OpenStack-train.repo

参考链接:https://stackoverflow.com/questions/78692851/could-not-retrieve-mirrorlist-http-mirrorlist-centos-org-release-7arch-x86-6

相关推荐
智象科技2 分钟前
智象科技:自动化模块驱动IT运维效能升级
运维·科技·自动化·itsm
小码农豪大大30 分钟前
windows服务器部署jenkins工具
运维·jenkins
hellolxb37 分钟前
Unreal Engine: Windows 下打包 AirSim项目 为 Linux 平台项目
linux·游戏引擎·虚幻
RLG_星辰1 小时前
SHELL练习题(1-11题)记录(牛客)
linux·运维·服务器·shell
敲上瘾1 小时前
企业开发工具git的使用:从入门到高效团队协作
linux·git·gitee·github·开发工具
时光飞逝的日子1 小时前
Ubuntu搭建TFTP服务器的方法
linux·ubuntu·tftp
code monkey.2 小时前
【寻找Linux的奥秘】第六章:环境变量
linux·操作系统·环境变量
✿ ༺ ོIT技术༻4 小时前
Linux:网络层的重要协议或技术
linux·服务器·网络
ICT系统集成阿祥5 小时前
负载均衡—会话保持技术详解
运维·负载均衡
付出不多5 小时前
linux——mysql高可用
linux·运维·mysql