今天我进行了常规 Ubuntu 更新
sudo apt update && sudo apt dist-upgrade
,并收到以下错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
linux-image-5.4.0-80-generic
0 to upgrade, 0 to newly install, 1 to remove and 1 not to upgrade.
2 not fully installed or removed.
After this operation, 11.8 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 366812 files and directories currently installed.)
Removing linux-image-5.4.0-80-generic (5.4.0-80.90) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-80-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found background image: wallpaper.png
Found linux image: /boot/vmlinuz-5.6.19-050619-generic
Found initrd image: /boot/initrd.img-5.6.19-050619-generic
Found linux image: /boot/vmlinuz-5.4.0-84-generic
Found initrd image: /boot/initrd.img-5.4.0-84-generic
Found linux image: /boot/vmlinuz-5.4.0-81-generic
Found initrd image: /boot/initrd.img-5.4.0-81-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
/etc/grub.d/35_fwupd: line 5: /usr/share/grub: Is a directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 126
dpkg: error processing package linux-image-5.4.0-80-generic (--remove):
installed linux-image-5.4.0-80-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.4.0-80-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
从那时起我就尝试
apt autoremote
apt clean
apt-get install -f
apt --fix-broken install
apt purge linux-image-5.4.0-80-generic
dpkg-reconfigure linux-image-5.4.0-80-generic
dpkg --purge linux-image-5.4.0-80-generic
我也已经检查了可用空间:
$ df -H /boot
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p6 212G 135G 67G 67% /
内核信息:
$ uname -a
Linux Knowhere 5.6.19-050619-generic #202006171132 SMP Wed Jun 17 16:31:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
这些都不起作用。有没有人见过这个错误,或者对我如何解决这个问题有什么建议。
附言:从错误跟踪来看,grub 似乎存在一些问题,但我不确定为什么会突然出现这个问题。
答案1
在 reddit 上搜索了一下,发现:
总结
好的,这解释了为什么我在包中找不到该文件https://packages.ubuntu.com/。
fwupd 的上游开发人员修复了这个错误,例如这,
即他们用 [ -d ${pkgdatadir:?} ] 替换了 ${pkgdatadir:?} 行
显然他们是报告该错误的人,因此他们意识到了这一点,并且已经修复了针对 hirsute 的软件包,只是没有修复针对 focal 的软件包。