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

devtools/2025/2/2 18:03:03/

文章目录

  • 安装最小化的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/devtools/155504.html

相关文章

使用 Iptables 实现网络安全策略:从入门到精通

使用 Iptables 实现网络安全策略:从入门到精通 在运维工作中,网络安全是重中之重,而 iptables 作为 Linux 内核自带的防火墙工具,提供了强大的流量控制能力。通过合理的 iptables 规则,我们可以有效防止未经授权的访问,保护服务器免受攻击。今天,我们就来深入探讨如何使…

Pyside的QWebEngineProfile类

QWebEngineProfile 是 PySide/Qt 中用于管理浏览器引擎&#xff08;WebEngine&#xff09;配置的类&#xff0c;属于 QtWebEngineCore 模块。它主要用于控制网页的全局行为&#xff0c;例如缓存、Cookie、持久化存储、用户代理&#xff08;User-Agent&#xff09;、代理设置等。…

基于物联网的智能环境监测系统(论文+源码)

1系统的功能及方案设计 本课题为基于物联网的智能环境监测系统的设计与实现&#xff0c;整个系统采用stm32f103单片机作为主控制器&#xff0c;通过DHT11传感器实现智能环境监测系统温度和湿度的检测&#xff0c;通过MQ传感器实现CO2浓度检测&#xff0c;通过光照传感器实现光照…

工业相机常用词语解释

线阵相机和面阵相机&#xff1a; 线阵相机&#xff0c;是采用线阵图像传感器的相机。线阵图像传感器以CCD为主&#xff0c; 一行的数据可以到几K甚至几十K&#xff0c;但是高度只有几个像素&#xff0c;行频很高&#xff0c;可以到每秒几万行&#xff0c;适合做非常高精度、宽…

使用Pygame制作“打砖块”游戏

1. 前言 打砖块&#xff08;Breakout / Arkanoid&#xff09; 是一款经典街机游戏&#xff0c;玩家控制一个可左右移动的挡板&#xff0c;接住并反弹球&#xff0c;击碎屏幕上方的砖块。随着砖块被击碎&#xff0c;不仅能获得分数&#xff0c;还可以体验到不断加速或复杂的反弹…

C++ 写一个简单的加减法计算器

************* C topic&#xff1a;结构 ************* Structure is a very intersting issue. I really dont like concepts as it is boring. I would like to cases instead. If I want to learn something, donot hesitate to make shits. Like building a house. Wh…

http跳转https

1、第一种&#xff1a;不好使 在nginx的配置中&#xff0c;在https的server站点添加如下头部&#xff1a; add_header Strict-Transport-Security “max-age63072000; includeSubdomains; preload”; 这样当第一次以https方式访问我的网站&#xff0c;nginx则会告知客户端的浏览…

详解u3d之AssetBundle

一.AssetBundle的概念 “AssetBundle”可以指两种不同但相关的东西。 1.1 AssetBundle指的是u3d在磁盘上生成的存放资源的目录 目录包含两种类型文件(下文简称AB包)&#xff1a; 一个序列化文件&#xff0c;其中包含分解为各个对象并写入此单个文件的资源。资源文件&#x…