1. Error reporting
2. The reason for the error
The system cannot parse the yum source for the following reasons
- The virtual machine cannot access the Internet! You need to check the network configuration to confirm that you can access the Internet and then look at the second situation
- Check if you can access the Internet: ping a public network pi
ping 114.114.114.114
- DNS configuration problem! Check if there is a problem with the DNS configuration You can do this
nslookup www.baidu.com
- If the above two situations are normal, but the yum source still cannot be parsed, you can try another yum source
3. Solutions
- The network adapter of VMware can be set to NAT or bridge mode
- Create network card file
- Table of contents:
cd /etc/sysconfg/network-scripts/
- Check if there is:
ifcfg-ens33
orifcfg-ens32
, if no file is created (no suffix)
- Table of contents:
- Modify the content of the
ifcfg-ens33
/ifcfg-ens33
file, open it for editing through the vim command
vim/vi ifcfg-ens33
bridge mode
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp" #如果是桥接模式dhcp自动获取,如果是NAT:static
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="ens33"
UUID="784d0f02-9840-411b-afc1-9d65850bd9dd"
DEVICE="ens33"
ONBOOT="yes"
BOOTPROTO="dhcp"
#If it is bridge mode,dhcp
it will be obtained automatically, if it is NAT:static
ONBOOT="yes"
turn on
If it is NAT
a model, you need to add these
DNS1=8.8.8.8
DNS2=223.5.5.5
GATEWAY=192.168.1.2 # 查看自己的参数最后配2,用来转发
NETMASK=255.255.255.0
IPADDR=192.168.1.180# 查看自己的参数
- IPADDR: The last three digits of IP+ are randomly selected from 0 to 155
- GATEWAY: gateway
- DNS: DNS configuration (used to solve problem 2)
Parameter view:
input:ip a
- restart network service
systemctl restart network.service
- Enter the command to view the IP address:
ip a
This is my network card configuration (NTA mode)
reference article: 1. https://blog.csdn.net/weixin_43232955/article/details/108290006
2. https://blog.csdn.net/qq_39720249/article/details/ 84065760