Debian 9下 Could not resolve 'mirrors.163.com' 的解决方法

突然某一天我的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

一切恢复正常

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值