CentOS7安装软件yum install 无法解析仓库URL

Determining fastest mirrors

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; 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.备份原有镜像源:

sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

2.下载新的镜像源配置文件(例如阿里云):

sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.清理并重建缓存:

sudo yum clean all

sudo yum makecache

sudo yum install net-tools

相关推荐
余辉zmh7 分钟前
【Linux系统篇】:从匿名管道到命名管道--如何理解进程通信中的管道?
linux·运维·microsoft
小锋学长生活大爆炸11 分钟前
【教程】检查RDMA网卡状态和测试带宽 | 附测试脚本
运维·服务器·网络·ubuntu·网卡·rdma
程序设计实验室14 分钟前
Traefik,想说爱你不容易:一场动态反向代理的心累之旅
linux·docker·devops·traefik·caddy
就新年快乐吧29 分钟前
【HD-RK3576-PI】定制用户升级固件
linux
爬菜41 分钟前
进程(完)
linux
事业运财运爆棚1 小时前
ssh 三级跳
服务器·web安全·ssh
Pseudo…1 小时前
linux Shell编程之函数与数组(四)
linux·运维·服务器
写代码的小阿帆1 小时前
内网Windows挂载目录到公网服务器
运维·服务器
日日行不惧千万里1 小时前
远程登录一个Linux系统,如何用命令快速知道该系统属于Linux的哪个发行版,以及该服务器的各种配置参数,运行状态?
linux·运维·服务器
lifewange1 小时前
日志查询 Less命令:/搜索
linux