Problem restoration:
When learning docker, use online tutorials to execute the following commands:
Step one:
yum update
Step 2:
yum -y install docker
(Recommended tutorial: centos tutorial)
But when updating yum, the following error is always reported when entering the command:
Solution idea:
When encountering this kind of problem, I immediately suspected whether it was a network problem, so I checked the network configuration file:
[root@hdp2 ~]# cd /etc/sysconfig/network-scripts/ [root@hdp2 network-scripts]# vi ifcfg-ens33
Found The network configuration file is inconsistent with the virtual network gateway and needs to be changed to make it consistent.
The solution is as follows:
After modifying the gateway to be consistent, enter the following command to restart the network.
service network restart
After completing this step, you can install docker, and then enter the command: yum update, and the network error will not be reported.
Recommended related video tutorials: linux video tutorial
The above is the detailed content of What should I do if something goes wrong when using yum to install software under centos7?. For more information, please follow other related articles on the PHP Chinese website!