一个月前,我发布了这个关于我的笔记本电脑在我的家庭网络上更新时明显冻结的话题。提示输入密码后,我的终端上不会显示任何内容。但是,在任何其他网络上,计算机都可以正常更新。没有时间深入研究,我得出的结论是这是一个驱动程序问题,我可以用 19.04 修复,所以我等待。
我现在有更多时间进行调查,因为切换到 19.04(使用我手机的热点)并没有改变任何我回馈给你的东西。
我注意到的第一件事是笔记本电脑实际上并没有冻结并且正在更新......它非常慢。
为了给你一个想法,这是在等待大约 15 分钟之后。每条线都需要一段时间才能最终出现,并且在最后一条线上又持续了 10 分钟。在那 10 分钟之后,它通过忽略接下来的get
阶段而自行解开了:
这不是网络速度问题,这是更新运行时速度测试的结果:
最后,这不是我的盒子阻塞了 ubuntu 服务器端口,因为我的桌面,同样运行具有类似设置的 19.04(特别是就要使用的更新服务器而言)在同一网络上更新得非常好。
任何想法 ?如果有帮助,有线和wifi连接的问题都是一样的
编辑:更新缓慢进行 50 分钟后的sitrep,请注意下载速度极低
编辑 2:经过研究,sources.list 是干净的,服务器不是问题。这是结果sudo strace apt update
:
munmap(0x7fd0b81fc000, 2783) = 0
close(5) = 0
geteuid() = 0
getegid() = 0
openat(AT_FDCWD, "/proc/sys/kernel/ngroups_max", O_RDONLY) = 5
read(5, "65536\n", 31) = 6
close(5) = 0
mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd0b72d2000
getgroups(65536, [0]) = 1
setgroups(1, [65534]) = 0
setresgid(-1, 65534, -1) = 0
setresuid(-1, 106, -1) = 0
getpid() = 5250
openat(AT_FDCWD, "/var/lib/apt/lists/partial/.apt-acquire-privs-test.9zhf7x", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/var/lib/apt/lists/partial/.apt-acquire-privs-test.9zhf7x") = 0
close(5) = 0
getpid() = 5250
openat(AT_FDCWD, "/var/lib/apt/lists/partial/.apt-acquire-privs-test.O5IFAd", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/var/lib/apt/lists/partial/.apt-acquire-privs-test.O5IFAd") = 0
close(5) = 0
getpid() = 5250
openat(AT_FDCWD, "/var/lib/apt/lists/partial/.apt-acquire-privs-test.1Rjq4S", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/var/lib/apt/lists/partial/.apt-acquire-privs-test.1Rjq4S") = 0
close(5) = 0
getpid() = 5250
openat(AT_FDCWD, "/var/lib/apt/lists/partial/.apt-acquire-privs-test.Vl5byy", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/var/lib/apt/lists/partial/.apt-acquire-privs-test.Vl5byy") = 0
close(5) = 0
getpid() = 5250
openat(AT_FDCWD, "/var/lib/apt/lists/partial/.apt-acquire-privs-test.lV2Y1d", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/var/lib/apt/lists/partial/.apt-acquire-privs-test.lV2Y1d") = 0
close(5) = 0
setresuid(-1, 0, -1) = 0
setresgid(-1, 0, -1) = 0
setgroups(1, [0]) = 0
munmap(0x7fd0b72d2000, 266240) = 0
stat("/usr/lib/apt/methods/http", {st_mode=S_IFREG|0755, st_size=174248, ...}) = 0
pipe([5, 6]) = 0
pipe([7, 8]) = 0
fcntl(5, F_SETFD, FD_CLOEXEC) = 0
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
fcntl(8, F_SETFD, FD_CLOEXEC) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fd0b78e5a50) = 5253
fcntl(5, F_GETFL) = 0 (flags O_RDONLY)
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(8, F_GETFL) = 0x1 (flags O_WRONLY)
fcntl(8, F_SETFL, O_WRONLY|O_NONBLOCK) = 0
close(6) = 0
close(7) = 0
select(6, [5], NULL, NULL, NULL) = 1 (in [5])
read(5, "100 Capabilities\nSend-Config: tr"..., 64000) = 64
faccessat(AT_FDCWD, "/usr/bin/auto-apt-proxy", R_OK|X_OK) = 0
pipe([6, 7]) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7fd0b78e5a50) = 5254
close(7) = 0
stat("/usr/bin/xz", {st_mode=S_IFREG|0755, st_size=80224, ...}) = 0
stat("/usr/bin/zstd", 0x7fffb91cf5f0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/lz4", 0x7fffb91cf5f0) = -1 ENOENT (No such file or directory)
stat("/bin/gzip", {st_mode=S_IFREG|0755, st_size=97336, ...}) = 0
stat("/usr/bin/xz", {st_mode=S_IFREG|0755, st_size=80224, ...}) = 0
stat("/bin/bzip2", {st_mode=S_IFREG|0755, st_size=38984, ...}) = 0
stat("/usr/bin/xz", {st_mode=S_IFREG|0755, st_size=80224, ...}) = 0
read(6, "", 4096) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5254, si_uid=106, si_status=0, si_utime=0, si_stime=0} ---
close(6) = 0
wait4(5254, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5254
stat("/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_disco_InRelease", 0x7fffb91cfc60) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/partial/archive.canonical.com_ubuntu_dists_disco_InRelease", 0x7fffb91cfd30) = -1 ENOENT (No such file or directory)
stat("/usr/lib/apt/methods/http", {st_mode=S_IFREG|0755, st_size=174248, ...}) = 0
pipe([6, 7]) = 0
pipe([9, 10]) = 0
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
fcntl(10, F_SETFD, FD_CLOEXEC) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7fd0b78e5a50) = 6110
fcntl(6, F_GETFL) = 0 (flags O_RDONLY)
fcntl(6, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(10, F_GETFL) = 0x1 (flags O_WRONLY)
fcntl(10, F_SETFL, O_WRONLY|O_NONBLOCK) = 0
close(7) = 0
close(9) = 0
select(7, [6], NULL, NULL, NULL) = 1 (in [6])
read(6, "100 Capabilities\nSend-Config: tr"..., 64000) = 64
faccessat(AT_FDCWD, "/usr/bin/auto-apt-proxy", R_OK|X_OK) = 0
pipe([7, 9]) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fd0b78e5a50) = 6111
close(9) = 0
read(7, "", 4096) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6111, si_uid=106, si_status=0, si_utime=0, si_stime=0} ---
close(7) = 0
wait4(6111, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 6111
stat("/var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_disco- updates_InRelease", 0x7fffb91cfc60) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/partial/fr.archive.ubuntu.com_ubuntu_dists_disco-updates_InRelease", 0x7fffb91cfd30) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/usr/bin/auto-apt-proxy", R_OK|X_OK) = 0
pipe([7, 9]) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7fd0b78e5a50) = 6896
close(9) = 0
read(7, ^C0x55feeddd9900, 4096) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
和输出ifconfig | grep errors
:
RX errors 0 dropped 0 overruns 0 frame 0
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
RX errors 0 dropped 0 overruns 0 frame 0
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
调查问题的步骤
这可能不一定是网络问题。
尝试禁用您之前使用过的任何自定义存储库 - 如果您有任何
/etc/apt/sources.list.d
. 其中之一可能会导致问题。如果您没有任何自定义存储库,您可以尝试使用:
或再次备份
/var/lib/apt/lists
并更新缓存,如下所示:如果问题仍然存在,请尝试使用
Applications menu
->Updates
->切换到其他 ubuntu 镜像Settings
,然后使用 ubuntu 软件转到第一个选项卡。将您的下载服务器更改为您居住的国家或任何其他国家。OP案例解决方案
在调查了 apt-get trough strace 后,发现
auto-apt-proxy
OP 的 PC 上安装了软件包。任何类型的代理都可能导致问题,如 OP 问题中所述。解决方案是基本上清除(卸载)此软件包并重新启动 PC。
在他的回答下,我们与 Comar 进行了长时间的讨论,最终得到了修复,所以我将在这里总结一下。
使用揭示了对他听起来并不熟悉的
sudo strace apt update
东西的多次引用。auto-apt-proxy
我删除了它,sudo apt purge auto-apt-proxy
并仔细检查了任何apt
使用的代理,sudo grep -i -rs proxy /etc/apt/
在调用apt purge
. 然后我重新启动以防万一,并运行了一个sudo apt update
完美执行的常规。所以我知道这个代理是什么(我不记得曾经要求我的机器安装这样的包)以及为什么它只在某些网络上阻止更新过程但删除它修复了所有问题。
希望这可以帮助将来的人。