CentOS7 VirtualBOX yum cannot be used

I can't use yum.

#yum list installed

Could not retrieve mirrorlist...
14:curl#6 - "Could not resolve host:mirrorlist.centos.org; Unknown error"
......

Search by error name and see the following article

https://qiita.com/taro0219/items/5bde092868b5ac817977

It seems to be an error when the name cannot be resolved. Set according to the article.

#ip a
2:enp0s3
3:enp0s8

#nmcli c modify enp0s3 ipv4.dns 8.8.8.8
Error: unknown connection 'enp0s9'.

It seems that the connection is not set. Check and set.

#nmcli device
DEVICE TYPE     STATE        CONNECTION
enp0s3 ethernet disconnected --
enp0s8 ethernet disconnected --

#nmcli connection show enp0s3 | grep connection
connection.autoconnect no

#nmcli connection modify enp0s3 connection.autoconnect yes

#nmcli device
DEVICE TYPE     STATE        CONNECTION
enp0s3 ethernet connected    enp0s3
enp0s8 ethernet disconnected --

Device and connection settings completed Do it again

#yum list installed

Could not retrieve mirrorlist...
14:curl#6 - "Could not resolve host:mirrorlist.centos.org; Unknown error"
......

Same error. Search for "yum not available" to see what hits

https://qiita.com/Nether_2046/items/bd897fdf16616ec90b67

It seems that DNS may not be set. I will check it immediately.

resolv.conf


nameserver 8.8.8.8

Set "8.8.8.8" because it was not set Run again

#yum list installed

.
.
.
.
.

I was able to execute it. It seems that yum list installed cannot be done without an internet connection. I wonder if the DNS settings depend on the host PC ... I will verify it next time.

Recommended Posts

CentOS7 VirtualBOX yum cannot be used
Because getSupportLoaderManager cannot be used
[PHP] Solved "mb_strpos cannot be used"
What to do when CentOS cannot be started with VirtualBox on Catalina
[Rails 6] method :: delete cannot be used with link_to
Why Java String typeclass comparison (==) cannot be used
Please note that Spring Boot + Tomcat 8.5.8 cannot be used!
Systemctl cannot be used on Ubuntu inside Docker container
Install CentOS Stream8 in VirtualBox
Install Apache on CentOS on VirtualBox
Java Stream cannot be reused.
Build an environment where pip3 can be used with CentOS7 + Python3
Note that system properties including JAXBContext cannot be used in Java11