yum出现Could not retrieve mirrorlist解决方法

简介: 在centos中使用yum安装软件时可能出现Could not retrieve mirrorlist,这种情况一般是网络出现问题。方法/步骤

oaded plugins: fastestmirror, security

Loading mirror speeds from cached hostfile

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was

14: PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrorlist.centos.org’”

Error: Cannot find a valid baseurl for repo: base


在centos中使用yum安装软件时可能出现Could not retrieve mirrorlist,这种情况一般是网络出现问题。

方法/步骤

1.如果配置的DHCP动态网络,则在/etc/resolv.conf文件中添加


2.nameserver 8.8.8.8


如果是静态网络,则在/etc/sysconfig/network-scripts/ifcfg-eth0文件中添加 注意:这里的DNS设置内容,不一定是这个,要根据实际情况使用,比如,我之前是用的就是 114.114.114.114 这里你可以使用DNS2 来添加新的内容,这样一来,就可以同时使用多个DNS地址了


DNS1=8.8.8.8

如果这个也不行,因为最近AI 多用这个跳转,你可以百度一下,其他的好用高速DNS代理节点。

27c5b41056b73e6df5ba31e2e1a9abff_4d345e935e9d189c2042910e7600fceb.png


3.然后重启网络服务,

service network restart

目录
相关文章
|
数据库
rpm yum 等命令无响应的解决方法
yum 安装查询任何东西, rpm 安装查询任何东西,执行后无任何反应,直接卡住,也没任何错误信息给出,只能杀掉进程 # yum install XXXX # yum clean all # rpm -qa # rpm -ivh XXX 执行全部无响应,只能kill 掉 原来是由于 rpm 的数据库出现异常了导致直接卡死了,造成这种异常通常是因为之前不正常的安装或查询。
2908 0
|
9月前
|
缓存
yum install ansible无法直接安装Ansible的解决方法
准备三台机器: server.example.com node1.example.com node2.example.com 配置IP,主机名,/etc/hosts
347 0
|
9月前
|
缓存 Linux 开发工具
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
630 0
|
12月前
[There are unfinished transactions remaining.]【使用本地YUM源安装服务报错解决方法】
[There are unfinished transactions remaining.]【使用本地YUM源安装服务报错解决方法】