突然某一天我的Debian 9出现下面的报错
:~$ sudo apt-get update
Err:1 http://mirrors.163.com/debian stretch-updates InRelease
Could not resolve 'mirrors.163.com'
Err:2 http://ftp.debian.org/debian stretch-backports InRelease
Could not resolve 'ftp.debian.org'
这是解析出错了
网上查了一下可以通过修改resolv.conf中的nameserver来解决
/lib/systemd/resolv.conf
nameserver 127.0.0.53 # 原来的没有动
nameserver 203.112.2.4 # 电信的DNS
nameserver 8.8.8.8 # 谷歌的DNS
重新启动 networking.service
sudo apt-get update
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:2 http://ftp.debian.org/debian stretch-backports InRelease [91.8 kB]
Get:3 http://security.debian.org/debian-security stretch/updates/main Sources [191 kB]
Hit:4 https://packages.sury.org/php stretch InRelease
Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [501 kB]
Ign:6 http://mirrors.ustc.edu.cn/debian stretch InRelease
Get:7 http://mirrors.ustc.edu.cn/debian stretch-backports InRelease [91.8 kB]
Get:8 http://mirrors.ustc.edu.cn/debian stretch-updates InRelease [91.0 kB]
Hit:9 http://mirrors.ustc.edu.cn/debian stretch Release
Get:11 http://mirrors.163.com/debian stretch-updates InRelease [91.0 kB]
Get:12 http://mirrors.163.com/debian stretch-updates/main Sources [13.4 kB]
Ign:13 http://download.webmin.com/download/repository sarge InRelease
Get:14 http://mirrors.163.com/debian stretch-updates/main amd64 Packages [27.4 kB]
Get:15 http://mirrors.163.com/debian stretch-updates/main Translation-en [11.3 kB]
Hit:16 http://download.webmin.com/download/repository sarge Release
Fetched 1,204 kB in 21s (57.2 kB/s)
Reading package lists... Done
一切恢复正常