CentOs :yum apt-get cannot find a valid baseurl for repo: base curl:unknown host
背景是win10下面安装Vm虚拟机 安装的是centos minimal 然后昨天ping 还能ping通的 但是无法yum和apt-get 今天起来就都不能用了 curl 提示unknown host; yum 提示 cannot find a valid baseurl for repo: base
于是又开始了百度,找了好多帖子 什么修改
/etc/sysconfig/network-scripts/
/etc/resolv.conf
这些都没有用 然后找到这个帖子: http://blog.csdn.net/u013264730/article/details/51146359 进去发现了这个链接: https://unix.stackexchange.com/questions/22924/how-can-i-fix-cannot-find-a-valid-baseurl-for-repo-errors-on-centos
最后一行代码解决: dhclient
当然 要给su权限

浙公网安备 33010602011771号