我使用的是 HP 笔记本电脑,并且看到以下消息:
sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.142) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-5.18.0-kali5-amd64 (5.18.5-1kali6) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.18.0-kali5-amd64
W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cml_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/dg1_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_dmc_ver2_14.bin for module i915
raspi-firmware: missing /boot/firmware, did you forget to mount it?
run-parts: /etc/initramfs/post-update.d//z50-raspi-firmware exited with return code 1
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.18.0-kali5-amd64 (--configure):
installed linux-image-5.18.0-kali5-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-5.18.0-kali5-amd64 (= 5.18.5-1kali6); however:
Package linux-image-5.18.0-kali5-amd64 is not configured yet.
dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.142) ...
update-initramfs: Generating /boot/initrd.img-5.18.0-kali5-amd64
W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cml_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/dg1_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_dmc_ver2_14.bin for module i915
raspi-firmware: missing /boot/firmware, did you forget to mount it?
run-parts: /etc/initramfs/post-update.d//z50-raspi-firmware exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.18.0-kali5-amd64
linux-image-amd64
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
由于您没有使用 Raspberry Pi,因此不需要该raspi-firmware
软件包;这就是导致错误的原因。跑步
sudo rm /etc/kernel/postinst.d/z50-raspi-firmware
sudo apt purge raspi-firmware
你需要清除包,而不仅仅是删除它,以确保各种z50-raspi-firmware
脚本也被删除。 postinst 脚本需要单独删除,因为它在非 Raspberry Pi 系统上崩溃。
答案2
发出命令
sudo mv /etc/initramfs/post-update.d/z50-raspi-firmware
执行此操作会将 Z50 固件移动到您的主目录,从而防止它在您每次尝试升级时运行。
我将其移至主目录以保留备份,以防出现问题。
答案3
当从 live CD 安装 debian-12 时,我遇到了类似的错误apt upgrade
,以下是修复它的方法:
$ sudo dpkg -P raspi-firmware
$ sudo apt-get dist-upgrade
$ sudo apt-get update && sudo apt-get upgrade
答案4
根据博客文章:https://itsfoss.com/dpkg-returned-an-error-code-1/解决这个问题的方法是删除麻烦包的帖子信息文件导致安装错误,因为您使用了 3 个软件包中提到的情况处理部分时遇到错误通过做 :
sudo mv /var/lib/dpkg/info/<packge name>.* /tmp