Ubuntu 20.04 中没有任何内容正在升级或更新。,,dpkg:处理软件包 linux-image-5.13.0-27-generic (--configure) 时出错:

Ubuntu 20.04 中没有任何内容正在升级或更新。,,dpkg:处理软件包 linux-image-5.13.0-27-generic (--configure) 时出错:

每当我尝试在 Ubuntu 上安装新软件包时,都会出现以下错误:

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.
Do you want to continue? [Y/n] y
Setting up linux-image-5.13.0-30-generic (5.13.0-30.33~20.04.1) ...
Setting up linux-image-5.13.0-28-generic (5.13.0-28.31~20.04.1) ...
Setting up linux-image-5.13.0-27-generic (5.13.0-27.29~20.04.1) ...
Processing triggers for linux-image-5.13.0-30-generic (5.13.0-30.33~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.13.0-30-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-30-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.13.0-30-generic (--configure):
 installed linux-image-5.13.0-30-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.13.0-28-generic (5.13.0-28.31~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.13.0-28-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-28-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.13.0-28-generic (--configure):
 installed linux-image-5.13.0-28-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.13.0-27-generic (5.13.0-27.29~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.13.0-27-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-27-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.13.0-27-generic (--configure):
 installed linux-image-5.13.0-27-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-5.13.0-30-generic
 linux-image-5.13.0-28-generic
 linux-image-5.13.0-27-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

在此处输入图片描述

我该如何解决这个问题?

答案1

我也遇到了同样的问题。评论经过没有人,对我有用:

sudo mv /etc/default/grub /etc/default/grub.bak
sudo cp /usr/share/grub/default/grub  /etc/default/
sudo dpkg --configure -a

这些命令将删除 处的当前 grub 配置/etc/default/grub,并从 处恢复默认 grub 配置/usr/share/grub/default/grub

相关内容