$ uname -a
Linux amnesia 5.0.0-32-generic #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 18.04.3 LTS \n \l
当我运行任何apt
涉及在线活动时,它都会停留在0% [Working]
大约 15 秒。
我的网络连接良好。
我阅读了很多关于这个问题的帖子,因此我IPv6
在两个 apt 中都禁用了它:
$ cat /etc/apt/apt.conf.d/99force-ipv4
Acquire::ForceIPv4 "true";
和sysctl
:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
我试过LC_ALL=C apt update
一些技巧,但没有成功。/var/lib/apt/lists
清理(rm -rf
、apt clean
和apt update
)也没有成功,我读到这解决了一些问题。
当执行该过程时strace
,我可以看到它卡在这里:
select(7, [6], NULL, NULL, NULL) = 1 (in [6])
read(6, "100 Capabilities\nSend-Config: tr"..., 64000) = 64
stat("/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease", {st_mode=S_IFREG|0644, st_size=242048, ...}) = 0
stat("/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_bionic_InRelease", 0x7ffdada965c0) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_InRelease", {st_mode=S_IFREG|0644, st_size=88722, ...}) = 0
stat("/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_bionic-updates_InRelease", 0x7ffdada965c0) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-backports_InRelease", {st_mode=S_IFREG|0644, st_size=74562, ...}) = 0
stat("/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_bionic-backports_InRelease", 0x7ffdada965c0) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-security_InRelease", {st_mode=S_IFREG|0644, st_size=88724, ...}) = 0
stat("/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_bionic-security_InRelease", 0x7ffdada965c0) = -1 ENOENT (No such file or directory)
select(11, [5 6], [8 10], NULL, {tv_sec=0, tv_usec=500000}) = 2 (out [8 10], left {tv_sec=0, tv_usec=499997})
write(10, "601 Configuration\nConfig-Item: A"..., 18918) = 18918
write(8, "601 Configuration\nConfig-Item: A"..., 17465) = 17465
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
0% [Working]) = 1313
select(7, [5 6], [], NULL, {tv_sec=0, tv_usec=500000}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
这是我的source.list
:
deb http://archive.ubuntu.com/ubuntu bionic main restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu bionic universe
deb http://archive.ubuntu.com/ubuntu bionic-updates universe
deb http://archive.ubuntu.com/ubuntu bionic multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted
deb http://archive.ubuntu.com/ubuntu bionic-security universe
deb http://archive.ubuntu.com/ubuntu bionic-security multiverse
我也尝试过在我附近放一面镜子,结果是一样的。
我没得选择了……
答案1
因此,我将我的互联网接入从无线电/LTE 升级到了光纤(Movistar),现在我住的地方可以使用了,延迟也消失了。100% 与网络有关,但仍然是个谜。
没有其他变化。我能够在前后尝试实际效果,毫无疑问这与我的互联网访问有关。