Home  >  Article  >  Operation and Maintenance  >  Executing yum command under centos always fails

Executing yum command under centos always fails

王林
王林Original
2020-03-30 11:43:262336browse

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

Executing yum command under centos always fails

(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

Executing yum command under centos always fails

#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:

Executing yum command under centos always fails

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn