CentOS系統Yum出現”Cannot find a valid baseurl for repo”問題解決辦法

來源:互聯網
上載者:User

有網友告知老左自己在騰訊雲端服務器上部署環境使用到yum命令的時候提示無法執行指令碼有出現"Cannot find a valid baseurl for repo"問題提示。看到這樣的問題肯定是源不通導致的,先搜尋搜尋是否有同樣的解決方案,有的人用到需要更新repo的,也有的簡單更新DNS的。

錯誤提示:
 代碼如下 複製代碼
[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
因為問題我也沒有遇到過,就先用簡單的方法試試,更換DNS。
 代碼如下 複製代碼
vi /etc/resolv.conf
然後將DNS換成兩組 8 8 8 8 和 8 8 4 4

儲存後退出,然後我們在執行yum命令可以看到是可以解決問題的。

搞定,ping www.111cn.net  順暢了,yum可以用了!第一件事情,就是去刪除 /etc/resolv.conf 裡面有問題的dns伺服器。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.