安装最小化的CentOS7后,执行yum命令报错Could not resolve host mirrorlist.centos.org; 未知的错误

server/2025/2/2 4:09:51/

文章目录

  • 安装最小化的CentOS7后,执行yum命令报错"Could not resolve host: mirrorlist.centos.org; 未知的错误"
    • 错误
    • 解决方案:

centosorg__1">安装最小化的CentOS7后,执行yum命令报错"Could not resolve host: mirrorlist.centos.org; 未知的错误"

错误

linux">[root@anonymous yum.repos.d]# yum list lrzsz
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
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 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 --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't 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 <repoid>orsubscription-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 muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: base/7/x86_64

解决方案:

(确保能够ping通114.114.114.114)

1.更新base.repo源

1.11备份文件

linux">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

1.12下载新的CentOS-Base.repo 到/etc/yum.repos.d/

linux">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

1.13运行yum makecache生成缓存


http://www.ppmy.cn/server/164244.html

相关文章

编译安装PaddleClas@openKylin(失败,安装好后报错缺scikit-learn)

编译安装 前置需求&#xff1a; 手工安装swig和faiss-cpu pip install swig pip install faiss-cpu 小技巧&#xff0c;pip编译安装的时候&#xff0c;可以加上--jobs64来多核编译。 注意先升级pip版本&#xff1a;pip install pip -U pip3 install faiss-cpu --config-s…

基于新一代电子电器架构的SOA服务设计方法

我是穿拖鞋的汉子&#xff0c;魔都中坚持长期主义的汽车电子工程师。 老规矩&#xff0c;分享一段喜欢的文字&#xff0c;避免自己成为高知识低文化的工程师&#xff1a; 简单&#xff0c;单纯&#xff0c;喜欢独处&#xff0c;独来独往&#xff0c;不易合同频过着接地气的生活…

刷题记录 贪心算法-3:376. 摆动序列

题目&#xff1a;376. 摆动序列 难度&#xff1a;中等 如果连续数字之间的差严格地在正数和负数之间交替&#xff0c;则数字序列称为 摆动序列 。第一个差&#xff08;如果存在的话&#xff09;可能是正数或负数。仅有一个元素或者含两个不等元素的序列也视作摆动序列。 例如…

【go语言】函数

一、什么是函数 函数是入门简单精通难&#xff0c;函数是什么&#xff1f;&#xff1f;&#xff1f; 函数就是一段代码的集合go 语言中至少有一个 main 函数函数需要有一个名字&#xff0c;独立定义的情况下&#xff0c;见名知意函数可能需要有一个结果&#xff0c;也可能没有…

CSRF 跨站请求伪造漏洞

原理 当一个网站A使用Cookie&#xff0c;存储Session或Token来用于单点登录和权限操作时。浏览器将Cookie存储到浏览器中。当用户在访问另一个网站V时&#xff0c;黑客可以通过伪造表单&#xff0c;向网站A发送修改重要信息(如密码)、支付等操作&#xff0c;浏览器会自动携带C…

深入剖析 Docker 的镜像分层存储机制

目录 一、基本原理 镜像构成 UnionFS 二、工作方式 镜像构建时 容器启动时 三、优势 共享与复用 高效存储和传输 快速镜像构建 可追溯性和可维护性 四、相关命令 查看镜像分层 基于已有镜像创建新镜像 Docker 凭借其卓越的性能和极高的灵活性,已然成为众多开发者…

算法随笔_30: 去除重复字母

上一篇:算法随笔_29:最大宽度坡_方法3-CSDN博客 题目描述如下: 给你一个字符串 s &#xff0c;请你去除字符串中重复的字母&#xff0c;使得每个字母只出现一次。需保证 返回结果的字典序最小&#xff08;要求不能打乱其他字符的相对位置&#xff09;。 示例 1&#xff1a; …

汽车网络信息安全-ISO/SAE 21434解析(中)

目录 第七章-分布式网络安全活动 1. 供应商能力评估 2. 报价 3. 网络安全职责界定 第八章-持续的网络安全活动 1. 网路安全监控 2. 网络安全事件评估 3. 漏洞分析 4. 漏洞管理 第九章-概念阶段 1. 对象定义 2. 网路安全目标 3. 网络安全概念 第十章 - 产品开发 第十…