Set the network card to start automatically at boot
To solve this problem, you must first confirm whether the network card has been started. The network card may be turned off when CentOS7 is first installed. You need to Turn it on by yourself.
Make sure you are using the root account. If not, please change it yourself.
1. Enter the /etc/sysconfig/network-scripts directory. That is, enter the command "cd /etc/sysconfig/network-scripts" and use the command "ls -a" to view all files in the directory.
(Recommended tutorial: centos usage tutorial)
2. Modify the network card configuration file of ifcfg-ens33 (CentOS7 modified the network card The naming rule is no longer eth0, but ifcfg-eno numbers). Enter the command "vi ifcfg-ens33" to enter the vi editor, and press the "i" or "insert" key to enter editing mode.
3. Change the value of "ONBOOT" to "yes", then press esc to exit the edit mode, enter ":wq" to save and exit.
#4. Restart the system or restart the network card, enter the command "reboot" or "service network restart".
Recommended related video tutorials: linux video tutorial
The above is the detailed content of centos cannot update using yum command. For more information, please follow other related articles on the PHP Chinese website!