今天我尝试了sudo apt upgrade
,但出现以下错误:E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
。
然而,当我dpkg --configure -a
(以 root 身份)运行它时,它会停留update-initramfs: Generating /boot/initrd.img-4.4.6-3-surface
几个小时。
我在 MS Surface Pro 3 上运行 Ubuntu 16.04(与 Windows 10 双启动,但之前从未遇到过问题)。
我还注意到,如果我尝试使用 GUI 关闭计算机,它只会停留在关机屏幕上,我必须手动关闭它。这个问题可能与第一个问题有关吗?
以下是输出sudo strace dpkg --configure -a
(我只包括开始和结束):
execve("/usr/bin/dpkg", ["dpkg", "--configure", "-a"], [/* 31 vars */]) = 0
brk(NULL) = 0x1938000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
// 缩写
wait4(6308, update-initramfs: deferring update (trigger activated)
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 6308
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6308, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x7f1caac934b0}, NULL, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f1caac934b0}, NULL, 8) = 0
open("/var/lib/dpkg/diversions", O_RDONLY) = 9
fcntl(9, F_GETFD) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=1280, ...}) = 0
close(9) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2971, ...}) = 0
write(7, "2018-04-22 16:11:04 status insta"..., 73) = 73
write(4, "Package: initramfs-tools\nStatus:"..., 1251) = 1251
ftruncate(4, 1251) = 0
fsync(4) = 0
close(4) = 0
rename("/var/lib/dpkg/updates/tmp.i", "/var/lib/dpkg/updates/0001") = 0
open("/var/lib/dpkg/updates/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fsync(4) = 0
close(4) = 0
open("/var/lib/dpkg/updates/tmp.i", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(4, "#padding\n#padding\n#padding\n#padd"..., 4096) = 4096
write(4, "padding\n#padding\n#padding\n#paddi"..., 512) = 512
lseek(4, 0, SEEK_SET) = 0
fcntl(5, F_GETFD) = 0x1 (flags FD_CLOEXEC)
fcntl(5, F_SETFD, FD_CLOEXEC) = 0
fcntl(5, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
close(6) = 0
open("/var/lib/dpkg/triggers/Unincorp", O_RDONLY) = 6
fcntl(6, F_GETFD) = 0
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
fstat(6, {st_mode=S_IFREG|0644, st_size=19, ...}) = 0
open("/var/lib/dpkg/triggers/Unincorp.new", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 9
fcntl(9, F_GETFD) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
ioctl(6, TCGETS, 0x7ffd02841050) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(6, {st_mode=S_IFREG|0644, st_size=19, ...}) = 0
read(6, "update-initramfs -\n", 8192) = 19
read(6, "", 4096) = 0
open("/var/lib/dpkg/triggers/update-initramfs", O_RDONLY) = 10
fstat(10, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
lseek(10, 0, SEEK_SET) = 0
read(10, "initramfs-tools\n", 4096) = 16
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2971, ...}) = 0
write(7, "2018-04-22 16:11:04 status trigg"..., 80) = 80
write(4, "Package: initramfs-tools\nStatus:"..., 1293) = 1293
ftruncate(4, 1293) = 0
fsync(4) = 0
close(4) = 0
rename("/var/lib/dpkg/updates/tmp.i", "/var/lib/dpkg/updates/0002") = 0
open("/var/lib/dpkg/updates/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fsync(4) = 0
close(4) = 0
open("/var/lib/dpkg/updates/tmp.i", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(4, "#padding\n#padding\n#padding\n#padd"..., 4096) = 4096
write(4, "padding\n#padding\n#padding\n#paddi"..., 512) = 512
lseek(4, 0, SEEK_SET) = 0
read(10, "", 4096) = 0
read(6, "", 8192) = 0
close(10) = 0
ioctl(6, TCGETS, 0x7ffd028410d0) = -1 ENOTTY (Inappropriate ioctl for device)
close(6) = 0
close(9) = 0
rename("/var/lib/dpkg/triggers/Unincorp.new", "/var/lib/dpkg/triggers/Unincorp") = 0
open("/var/lib/dpkg/triggers", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
fstat(6, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fsync(6) = 0
close(6) = 0
fcntl(5, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
write(1, "Processing triggers for initramf"..., 62) = 62
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2971, ...}) = 0
write(7, "2018-04-22 16:11:04 trigproc ini"..., 72) = 72
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2971, ...}) = 0
write(7, "2018-04-22 16:11:04 status half-"..., 79) = 79
write(4, "Package: initramfs-tools\nStatus:"..., 1289) = 1289
ftruncate(4, 1289) = 0
fsync(4) = 0
close(4) = 0
rename("/var/lib/dpkg/updates/tmp.i", "/var/lib/dpkg/updates/0003") = 0
open("/var/lib/dpkg/updates/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fsync(4) = 0
close(4) = 0
open("/var/lib/dpkg/updates/tmp.i", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(4, "#padding\n#padding\n#padding\n#padd"..., 4096) = 4096
write(4, "padding\n#padding\n#padding\n#paddi"..., 512) = 512
lseek(4, 0, SEEK_SET) = 0
stat("/var/lib/dpkg/info/initramfs-tools.postinst", {st_mode=S_IFREG|0755, st_size=282, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1cab442ad0) = 6312
rt_sigaction(SIGQUIT, {SIG_IGN, [], SA_RESTORER, 0x7f1caac934b0}, {SIG_DFL, [], SA_RESTORER, 0x7f1caac934b0}, 8) = 0
rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1caac934b0}, {SIG_DFL, [], SA_RESTORER, 0x7f1caac934b0}, 8) = 0
wait4(6312, update-initramfs: Generating /boot/initrd.img-4.4.6-3-surface
0x7ffd02840f84, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(6312,
此外,ps -p 6312
收益
PID TTY TIME CMD
6312 pts/17 00:00:00 initramfs-tools
答案1
这似乎是一个已知的错误:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1667512
我的建议是:终止更新过程,卸载除绝对必要的驱动器(根驱动器和主驱动器)之外的所有驱动器,然后重试。我建议不是重新启动直到你完成此操作为止。