Focus on cloud service provider activities
Notes on website operation and maintenance

Solve the problem of "Cannot find a valid baseurl for repo" in Yum of CentOS system

A netizen told Lao Zuo that when he used the yum command in the deployment environment of Tencent ECS, he was prompted that the script could not be executed. There was a "Cannot find a valid baseurl for repo" problem prompt. This problem must be caused by the lack of access to the source. Search first to see if there is the same solution. Some people need to update the repo, while others simply update the DNS.

 Cannot find a valid baseurl for repo

Error prompt:

[ 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
Could not retrieve mirrorlist 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

Because I haven't encountered any problems, I will try the simple method to change DNS.

vi /etc/resolv.conf

Then change DNS into two groups 8 8 8 8 8 and 8 8 4 4

After saving, exit. Then we can see that the problem can be solved by executing the yum command.

 Resolve YUM compilation problems

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( two )
Do not reprint without permission: Lao Zuo's Notes » Solve the problem of "Cannot find a valid baseurl for repo" in Yum of CentOS system


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge