CentOS7 yum installation error: "Could not resolve host: mirrorlist.centos.org; Unknown error"

This error pops up when the virtual machine installs something through yum:

Insert image description here

1. Check the network card installed on this machine

The network card ens33 is in disconnected state

nmcli d

Insert image description here

2. Enter the command:
nmtui

Insert image description here

3. Select the network card and click edit

Insert image description here

4. Move to Automatically connect and press the space bar to select, then move to the OK key and press the space bar to select, and then press quit when returning to the previous page.

Insert image description here

5. Enter the code to restart the network card:
systemctl restart network
yum can be used

Guess you like

Origin blog.csdn.net/agatha_aggie/article/details/132874278