首页 > 系统相关 >CentOS 7 - Could not resolve host: mirrorlist.centos.org; Unknown error

CentOS 7 - Could not resolve host: mirrorlist.centos.org; Unknown error

时间:2025-01-15 14:11:13浏览次数:1  
标签:resolve centos repository CentOS mirrorlist yum org

CentOS 7 当运行 yum update时,提示错误信息

Could not resolve host: mirrorlist.centos.org; Unknown error
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 One of the configured repositories failed (Unknown),
 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: base/7/x86_64

解决方法

从 2024 年 7 月 1 日起,在 CentOS 7 上,请切换到 Vault 存档存储库:

vi /etc/yum.repos.d/CentOS-Base.repo

删除原来的内容,复制/粘贴以下内容并注意您的操作系统版本。如果需要,请更改。
此配置中的版本为 7.9.2009:

[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

然后运行:

yum clean all
yum update

Ref:

END.

标签:resolve,centos,repository,CentOS,mirrorlist,yum,org
From: https://www.cnblogs.com/eddyz/p/18672890

相关文章

  • 如何在CentOS中打开或放行指定端口
    在CentOS系统中,管理防火墙规则以开放或关闭特定端口是确保服务器安全性和功能正常运行的重要步骤。无论是为了部署Web服务、数据库访问还是其他网络应用,正确配置防火墙可以防止未经授权的访问,同时允许合法的流量通过。以下是详细的步骤和注意事项,帮助您在CentOS中安全地打开或关闭......
  • centos7离线升级内核
    1.升级说明1.1系统默认信息系统版本:CentOS7.8默认内核版本:3.10.0-1127.el7.x86_641.2升级内核目的部署k8s需要1.3k8s官方要求cpu:2核以上mem:2G以上内核:4.x以上1.4升级内核版本(永久支持)CentOS7.8内核升级为:5.4.278 2.下载内核包地址(centos7内核升级)https......
  • Centos7.9离线部署ceph(octopus)
    原创文档编写不易,未经许可请勿转载,目前仅发布于博客园,其他平台均为非法转载。文档中有疑问的可以邮件联系我文章。邮箱:yinwanit@163.com说明文档适用于cenots7.9操作系统下部署cephoctopus版本分布式存储使用。离线部署的本质是先基于在线环境如vmwareworkstation虚拟机在线......
  • idea中,在pom文件引入jwt使用,JwtTes测试报错Cannot resolve method ‘withClaim(String
    JwtTes测试类中报错Cannotresolvemethod'withClaim(String,Map<String,Object>)'  1.报错报这个错误可能是jwt版本问题,下面请看我的报错文件JwtTest.javapom.xml找了好一会,以为是没加分号的原因,以为是用了中文标点,结果检查了一遍,代码没有问题,标点没有问题。......
  • centos7 2节点搭建mha
    配置主从同步:创建用于同步的用户:createuserrepl@'%'identifiedby'Admin@123';grantREPLICATIONCLIENT,REPLICATIONSLAVEon*.*torep@'%';创建用户mha连接的用户:CREATEUSER'mha'@'%'IDENTIFIEDWITHmysql_native_passwordB......
  • centos(linux): 安装php8.4.1的报错
    一,配置时报错:1,报错configure:error:Packagerequirements(xpm)werenotmet:Package'xpm',requiredby'virtual:world',notfound解决:[root@blog~]#dnfinstalllibXpm-devel2,报错:checkingforicu-uc>=50.1icu-ioicu-i18n...noconf......
  • CentOS7下Hadoop集群分布式安装详细图文教程
    1、集群规划主机角色DSS20NameNode  DataNode ResourceManager NodeManagerDSS21SecondaryNameNode NameNode     NodeManagerDSS22DataNode     NodeManager1.1、环境准备1.1.1 关闭防火墙#查看防火墙状态firewall-cmd......
  • 如何在 CentOS 上重启宝塔面板?
     在CentOS系统上重启宝塔面板可以通过两种方法实现:通过宝塔面板界面操作和通过SSH命令行操作。以下是详细的步骤:1.通过宝塔面板界面重启登录宝塔面板:打开浏览器,输入你的服务器域名或IP地址,加上宝塔面板的端口号(默认是8888),例如 http://域名:8888。输入你的用户名......
  • 如何在CentOS云服务器上一键自动挂载磁盘?
    对于新手来说,通过命令行手动挂载磁盘可能会有一定的难度。幸运的是,使用宝塔面板的一键挂载脚本可以简化这个过程。该脚本经过优化,直接绑定UUID以避免分区飘移问题,并能自动将硬盘挂载到/www目录。如果之前已经安装了宝塔面板,脚本会自动迁移数据到新的磁盘并挂载到/www目录中。不过,......
  • Linux(Centos 7.6)命令详解:split
    1.命令作用Linux系统中的一个用于拆分文件的命令。它可以将一个大文件拆分成多个小文件,以便于传输、存储或处理2.命令语法Usage:split[OPTION]...[INPUT[PREFIX]]Usage:split[选项]... [输入文件][输出文件前缀]3.参数详解OPTION:-a,--suffix-length=N,生成分裂......