文章内容
2021/7/21 9:50:04,作 者: 黄兵
E: Sub-process /usr/bin/dpkg returned an error code (1)
今天再更新Ubuntu 20.04系统的时候出现了如下错误:
update-initramfs: Generating /boot/initrd.img-5.4.0-77-generic Error 24 : Write error : cannot write compressed block E: mkinitramfs failure cpio 141 lz4 -9 -l 24 update-initramfs: failed for /boot/initrd.img-5.4.0-77-generic with 1. dpkg: error processing package linux-firmware (--configure): installed linux-firmware package post-installation script subprocess returned error exit status 1 Setting up linux-image-5.4.0-80-generic (5.4.0-80.90) ... dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-firmware; however: Package linux-firmware is not configured yet. dpkg: error processing package linux-image-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-image-generic (= 5.4.0.80.84); however: Package linux-image-generic is not configured yet. dpkg: error processing package linux-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Processing triggers for initramfs-tools (0.136ubuntu6.6) ... update-initramfs: Generating /boot/initrd.img-5.4.0-77-generic Error 24 : Write error : cannot write compressed block E: mkinitramfs failure cpio 141 lz4 -9 -l 24 update-initramfs: failed for /boot/initrd.img-5.4.0-77-generic with 1. dpkg: error processing package initramfs-tools (--configure): installed initramfs-tools package post-installation script subprocess returned error exit status 1 Processing triggers for linux-image-5.4.0-80-generic (5.4.0-80.90) ... No apport report written because MaxReports is reached already /etc/kernel/postinst.d/initramfs-tools: update-initramfs: Generating /boot/initrd.img-5.4.0-80-generic Error 24 : Write error : cannot write compressed block E: mkinitramfs failure cpio 141 lz4 -9 -l 24 update-initramfs: failed for /boot/initrd.img-5.4.0-80-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 dpkg: error processing package linux-image-5.4.0-80-generic (--configure): installed linux-image-5.4.0-80-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-firmware linux-image-generic linux-generic initramfs-tools linux-image-5.4.0-80-generic E: Sub-process /usr/bin/dpkg returned an error code (1)
出现问题的原因:
错误消息“Sub-process /usr/bin/dpkg returned an error code (1)
”表示包安装程序存在问题。在软件安装失败或安装程序损坏后,这可能会在 Ubuntu 中发生。
此错误中的关键短语是/usr/bin/dpkg
。这是指 Linux 的 dpkg 软件包安装程序。软件包安装程序是一种跟踪软件、更新和依赖项的应用程序。如果它已损坏,任何新的软件安装都会导致此错误消息。
解决方案:
方法一:
重新配置dpkg数据库,如果您的包数据库已损坏,重新配置它可以修复它:
sudo apt-get install -f
如果方法一无法修复问题,可以尝试方法二。
方法二:
修复包安装程序中的依赖项:
sudo apt-get install -f
该-f
选项意味着fix-broken
。它会修复包管理器中任何损坏的依赖项。当下载中断或缓存下载出现问题时,会发生依赖关系中断。
如果上面仍然无法更新成功,可以清理安装包看看:
sudo apt autoremove
参考资料:
1、How to Fix sub-process /usr/bin/dpkg returned an error code (1) in Ubuntu
黄兵个人博客原创。
转载请注明出处:黄兵个人博客 - E: Sub-process /usr/bin/dpkg returned an error code (1)
评论列表