修改apt-get服务器,云服务器使用sudo apt-get update 失败的原因及解决方法(unubtu下)...

今天在使用云服务器安装东西的时候,更新软件包,突然发现失败了,出现了以下情况:

08f466b9ce6c175fa7e8578bebd12062.png

苦苦寻找原因,各种答案,都没能成功解决问题,后来把出错的英语翻译了一下,大概的意思就是,获取包返回失败,后来想想是不是DNS的问题,然后重点来了

我输入:cat /etc/resolv.conf

root@whcckj:~# cat /etc/resolv.conf

# This file is managed by man:systemd-resolved(8). Do not edit.

#

# This is a dynamic resolv.conf file for connecting local clients to the

# internal DNS stub resolver of systemd-resolved. This file lists all

# configured search domains.

#

# Run "systemd-resolve --status" to see details about the uplink DNS servers

# currently in use.

#

# Third party programs must not access this file directly, but only through the

# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,

# replace this symlink by a static file or a different symlink.

#

# See man:systemd-resolved.service(8) for details about the supported modes of

# operation for /etc/resolv.conf.

nameserver 127.0.0.53

search openstacklocal

标蓝的地方就是问题所在,于是我们修改这个标蓝的地方

vi /etc/resolv.conf

改成 namesever 8.8.8.8

保存退出(先按下ESC,在输入:wq,回车搞定),然后使用sudo apt-get update

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值