Home > Article > Operation and Maintenance > Executing yum command under centos always fails
Problem:
Executing the yum command displays the Could not resolve host: mirrorlist.centos.org; Unknown error error.
Solution:
1. Use the following command to add the DNS service in the resolve.conf file.
vi /etc/resolv.conf
(Recommended tutorial: centos tutorial)
2. Use the following command to add DNS service to the ifcfg-ens33 file .
vi /etc/sysconfig/network-scripts/ifcfg-ens33
#3. Use the following command to restart the network card.
service network restart
4. Use the yum command to install gcc and test whether yum works well.
yum -y install gcc pcre-devel openssl openssl-devel
The result is as shown:
Recommended related video tutorials: linux video tutorial
The above is the detailed content of Executing yum command under centos always fails. For more information, please follow other related articles on the PHP Chinese website!