处理时遇到错误:initramfs-tools linux-firmware Ubuntu 18.04

处理时遇到错误:initramfs-tools linux-firmware Ubuntu 18.04

每当我跑步

sudo dpkg --configure -a

我收到这个错误

> Processing triggers for initramfs-tools (0.130ubuntu3.7) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-46-generic
Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring.
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.15.0-46-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Setting up linux-firmware (1.173) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-46-generic
Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring.
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.15.0-46-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
 linux-firmware

经过谷歌搜索后,我发现这与分区已满有关/boot,但显然不是,结果如下dh -f

Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
tmpfs           1.6G  1.9M  1.6G   1% /run
/dev/sda9        83G   17G   62G  22% /
tmpfs           7.8G  105M  7.7G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/loop2       90M   90M     0 100% /snap/core/6673
/dev/loop3      196M  196M     0 100% /snap/vlc/555
/dev/loop0       54M   54M     0 100% /snap/core18/970
/dev/loop1       18M   18M     0 100% /snap/chromium-ffmpeg/9
/dev/loop5       54M   54M     0 100% /snap/core18/941
/dev/loop6      141M  141M     0 100% /snap/gnome-3-26-1604/78
/dev/loop27      89M   89M     0 100% /snap/core/6964
/dev/loop29     239M  239M     0 100% /snap/kde-frameworks-5-core18/26
/dev/loop26     203M  203M     0 100% /snap/vlc/768
/dev/sda1       256M   35M  222M  14% /boot/efi
tmpfs           1.6G   64K  1.6G   1% /run/user/1000

我也无法安装/更新/升级任何软件包,也无法使用 dpkg 和 apt-get。我还删除了旧内核。这似乎是一个无限循环的错误,它们都让我回到那个错误

Errors were encountered while processing:  
initramfs-tools  
linux-firmware

输出apt policy e2fsprogs libext2fs2

e2fsprogs:
  Installed: (none)
  Candidate: 1.44.1-1
  Version table:
     1.44.1-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
     1.42.13-1ubuntu1 -1
        100 /var/lib/dpkg/status
libext2fs2:
  Installed: 1.44.1-1ubuntu1.1
  Candidate: 1.44.1-1ubuntu1.1
  Version table:
 *** 1.44.1-1ubuntu1.1 100
        100 /var/lib/dpkg/status
     1.44.1-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

答案1

从您输出的这两行,我得出结论,该包e2fsprogs丢失或损坏:

Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring.
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.

第一行直接说/sbin/fsck.ext4缺少,这是我提到的那个包提供的文件。检查第二行中提到的失败脚本,结果发现这个脚本需要/sbin/dumpe2fs,它也是由同一个包提供的。

要修复此问题,您应该通过运行以下命令(重新)安装e2fsprogs

sudo apt install --reinstall e2fsprogs

事实上,包含失败的fixrtcinitramfs 钩子 ( initramfs-tools-core) 的包并不依赖于看似必需的e2fsprogs包,这可能应该被视为一个错误。我已经在 Launchpad 上报告了此事。


更新:

由于它与您从未知且不再可用的来源安装的e2fsprogs不兼容版本冲突而拒绝安装,因此我们必须在该过程中将该其他软件包降级回受支持的版本:libext2fs2

sudo apt install --reinstall e2fsprogs libext2fs2=1.44.1-1

答案2

检查终端中的文本。我的终端说无法创建某个 vmlinuz 文件,因此我手动在它指示的目录中创建了它。然后我能够重新安装 e2fsprogs,它运行正常。

相关内容