What to do if yum installation fails under centos

王林
Release: 2020-03-26 17:43:11
Original
5759 people have browsed it

What to do if yum installation fails under centos

1. Check whether you can access the Internet

ping www.baidu.com
Copy after login

2. If you cannot access the Internet:

1. cd to /etc/sysconfig/network -scripts/

cd /etc/sysconfig/network-scripts/
Copy after login

(Recommended tutorial: centos tutorial)

2. ls finds ifcfg-**** (the asterisk part is random) and open it with vi

3. Change ONBOOT=no to yes

4. :wq Save and exit

5. Restart the network service

service network restart
Copy after login

3. If possible The network is connected, but the installation of yum install links (example) fails. The reason is that the speed is too slow, just change the mirror source. As follows:

1. Back up your original image file so that you can restore it after making an error.

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Copy after login

If you can’t find the original one, just use the new source directly.

2. Download the new CentOS-Base.repo to /etc/yum.repos.d/

CentOS 7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Copy after login

or

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Copy after login

3. Run yum makecache to generate cache

Recommended related video tutorials: linux video tutorial

The above is the detailed content of What to do if yum installation fails under centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template