yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法

简介: yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法

[yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法]


yum出现Could not retrieve mirrorlist解决方法

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

DNS1=8.8.8.8

[zry@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-ens192 
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens192"
UUID="1112d635-5cbc-4e01-a152-dfdf7357099a"
DEVICE="ens192"
ONBOOT="yes"
IPADDR="10.10.1.56"
PREFIX="24"
GATEWAY="10.10.1.1"
DNS1=8.8.8.8
DNS2=114.114.114.114
IPV6_PRIVACY="no"
  1. 然后重启网络服务,
    service network restart


目录
相关文章
|
数据库
rpm yum 等命令无响应的解决方法
yum 安装查询任何东西, rpm 安装查询任何东西,执行后无任何反应,直接卡住,也没任何错误信息给出,只能杀掉进程 # yum install XXXX # yum clean all # rpm -qa # rpm -ivh XXX 执行全部无响应,只能kill 掉 原来是由于 rpm 的数据库出现异常了导致直接卡死了,造成这种异常通常是因为之前不正常的安装或查询。
3079 0
|
2月前
|
数据库 容器
RPM属性依赖的解决方法: YUM线上升级
【5月更文挑战第14天】RPM属性依赖的解决方法: YUM线上升级。
26 1
|
11月前
|
缓存
yum install ansible无法直接安装Ansible的解决方法
准备三台机器: server.example.com node1.example.com node2.example.com 配置IP,主机名,/etc/hosts
417 0
|
8月前
|
人工智能 网络协议 安全
yum出现Could not retrieve mirrorlist解决方法
在centos中使用yum安装软件时可能出现Could not retrieve mirrorlist,这种情况一般是网络出现问题。 方法/步骤
677 0
|
11月前
|
缓存 Linux 开发工具
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法
896 0
[There are unfinished transactions remaining.]【使用本地YUM源安装服务报错解决方法】
[There are unfinished transactions remaining.]【使用本地YUM源安装服务报错解决方法】
|
缓存 Linux 虚拟化
linux下yum安装时出现Loaded plugins: fastestmirror解决办法
linux下yum安装时出现Loaded plugins: fastestmirror解决办法
1135 0