Ubuntu apt update卡在Connecting to security.ubuntu.com解决方法

Ubuntu操作系统运行apt update命令时会卡在Connecting to security.ubuntu.com,搭了梯子也无法解决

尝试了网络上的方法,如:
https://blog.csdn.net/v6543210/article/details/81562266
https://ubuntuqa.com/article/1400.html
但这些方法是解决由于访问security.ubuntu.com ipv6地址造成的无法访问的问题,所以对于我的问题并不管用。

后来通过网站 https://www.easycounter.com/report/security.ubuntu.com 查询到了security.ubuntu.com的DNS records

然后

sudo vi /etc/hosts

修改security.ubuntu.com的DNS为网站中查询到的任意值

重新运行

sudo apt update

就可以解决问题了

原文地址:https://www.cnblogs.com/brianleelxt/p/13216429.html