ubuntu apt-get update 失败

修改dns:

1

sudo vi /etc/resolvconf/resolv.conf.d/base

在里面插入:
nameserver 8.8.8.8
nameserver 8.8.4.4

修改好保存!wq,

然后执行

1

sudo resolvconf -u

再看/etc/resolv.conf,最下面就多了2行:

1

cat /etc/resolv.conf

 显示

1

2

3

4

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 8.8.8.8

nameserver 8.8.4.4

此时执行

1

sudo apt-get update

可以运行

猜你喜欢

转载自blog.csdn.net/qq_40012404/article/details/81103213