Solution to the "Cannot find a valid baseurl for repo" error in CentOS Yum

Source: Internet
Author: User
Tags centos

Some netizens told the Old Man to prompt that "Cannot find a valid baseurl for repo" could not be executed when deploying the environment on the Tencent ECS to use the yum command. The problem is certainly caused by source failure. Search for the same solution first. Some people use the repo to update and some simply update dns.

Error message:
The code is as follows: Copy code
[Root @ VM_17_139_centos ~] # Yum-y install wget screen python
Loaded plugins: fastestmirror, security
Setting up Install Process
Repository updates is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Cocould not retrieve than list http://mirrorlist.centos.org /? Release = 6 & arch = x86_64 & repo = OS & infra = stock error was
12: Timeout on http://mirrorlist.centos.org /? Release = 6 & arch = x86_64 & repo = OS & infra = stock: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds ')
Error: Cannot find a valid baseurl for repo: base
I have never encountered any problems, so I should try a simple method to change DNS.
The code is as follows: Copy code
Vi/etc/resolv. conf
Then, replace the DNS with two groups: 8 8 8 8 and 8 8 4 4.

Save and exit. Then we can see that the problem can be solved by executing the yum command.

Ping www.111cn.net. yum can be used! The first thing is to delete the problematic dns server in/etc/resolv. conf.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.