sudo apt 更新,卡在 0% 连接

eri*_*i0o 10 apt

当我执行 sudo apt update 时,我一直卡在下面的行中:

0% [Connecting to security.ubuntu.com (2001:67c:1360:8001::21)] 
Run Code Online (Sandbox Code Playgroud)

Ubuntu 中的 ipv6 分辨率有问题吗?如果这是问题,有没有办法强制使用 ipv4?(也许我的路由器不太聪明,我不知道)。

平输出:

ping6 2001:67c:1360:8001::21
PING 2001:67c:1360:8001::21(2001:67c:1360:8001::21) 56 data bytes
^C
--- 2001:67c:1360:8001::21 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11000ms
Run Code Online (Sandbox Code Playgroud)

跟踪路由输出:

 traceroute6  2001:67c:1360:8001::21traceroute to 2001:67c:1360:8001::21
 , 30 hops max, 24 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
Run Code Online (Sandbox Code Playgroud)

小智 20

-o Acquire::ForceIPv4=true在您的apt-get命令之后添加将强制 IPv4 连接。

要永久修复,请创建一个名为的文件 /etc/apt/apt.conf.d/99force-ipv4并向其中添加以下行:

Acquire::ForceIPv4 "true"; 
Run Code Online (Sandbox Code Playgroud)


Sco*_*and 9

不时......就像在旅行到一个新位置之后......通过运行这个探针来更新你本地最快的ubuntu repo服务器是件好事

System Settings -> 
Software & Updates -> 
Download from -> 
Other -> 
Select Best Server
Run Code Online (Sandbox Code Playgroud)

  • 您如何从 CLI 执行此操作? (2认同)