Solve Centos yum update Error
Today, centos 7 is installed in VM10, which has many problems, one of which is the failure of yum update. This problem is caused by my local network limitations and cannot connect to the image address of centos.
The error message is as follows:
Loaded plugins: fastestmirror, langpacks
1. dns Problems
2. Image connection Error
DNS Problems
First, let's talk about the dns problem. The test method is to ping the Internet and find that the ping fails.
Solution:
Echo "nameserver 8.8.8.8">/etc/resolv. conf
Image connection Error
If this is the second problem, consider using a domestic image, such as a 163 image.
Solution:
Take centos 7 as an example. You can change the number of other versions to a large version.
Cd/etc/yum. repos. d
Mv CentOS-Base.repo CentOS-Base.repo.bak
Vi CentOS-Base.repo
[base]name=Red Hat Enterprise Linux 7.0 -Basebaseurl=http://mirrors.163.com/centos/7/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7[update]name=Red Hat Enterprise Linux 7.0 -Updatesbaseurl=http://mirrors.163.com/centos/7/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7[extras]name=Red Hat Enterprise Linux 7.0 -Extrasbaseurl=http://mirrors.163.com/centos/7/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
Save it.