Tag Archives: Yum command error

[Solved] Yum command error: could not retrieve mirrorlist http://mirrorlist.centos.org…

Yum command error reporting solution

Problem Description:

An error occurs when running the yum install gcc-c + + command on the VMware virtual machine

Error message:

could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64%repo=os error was 14: PYCURL ERROR 
6 - "Counldn't resolve host 'mirrorlist.centos.org'"

Possible cause analysis:

1. DNS is not set

2. The connection mode of the network adapter is incorrect. The NAT mode is used locally and the bridge mode is used for the router

3. IP is not in the same network segment

4. The virtual machine service is not turned on

Solution:

1. Open the virtual machine — > Virtual machine settings — > Network adapter — > Network connection, set to bridge mode

2. Open ifcfg eno16777736 under etc/sysconfig/network scripts (the file name may be different), and set:

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=4875d5bc-07e0-4951-8cd3-3fa7570c6201
ONBOOT=yes
HWADDR=00:0C:29:12:7C:E7
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

 

3. Open the resolv.conf file in the directory etc and set:

3.1 if the network cable is directly connected to the local route, make the following settings:

domain www.tendawifi.com            [loacal DNS]
search www.tendawifi.com            [loacal DNS]
nameserver 192.168.0.1                [loacal IP]

3.2 if WiFi is connected, set:

# this is google DNS
nameserver 8.8.8.8
nameserver 8.8.4.4

# localhost DNS
nameserver 168.192.1.1            [local default gateway]
nameserver 168.192.1.101 [local IPv4 address]
search localdomain [fixed, means search local DNS]

4. Restart the service, service network restart, Ping Google Ping www.google.com