处理软件包 linux-image-5.8.0-44-generic 时出错

处理软件包 linux-image-5.8.0-44-generic 时出错

我似乎无法修复这个错误,我尝试了好几天寻找解决方案但找不到解决我的特定问题的方法,我希望有人可以提供帮助。

这个错误发生在我试图将我的 python==3.8 降级到 python==3.7 之后,但由于某种原因我不得不停止操作,后来我还在我的笔记本电脑(Inspiron 15 55575)上安装了 SSD。当我尝试设置我的 SSD 时,我无法做任何事情,因为同样的错误不断发生。

这些是我尝试过的一些解决方案。

在运行sudo apt full-upgrade一些论坛建议的程序后,我一直收到这个错误。

Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/9,499 kB of archives.
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.8.0-48-generic (5.8.0-48.54~20.04.1) ...
Setting up grub-pc (2.04-1ubuntu26.9) ...
/var/lib/dpkg/info/grub-pc.config: 10: /etc/default/grub: splash: not found
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit statu
s 127
Setting up linux-image-5.8.0-44-generic (5.8.0-44.50~20.04.1) ...
Processing triggers for linux-image-5.8.0-48-generic (5.8.0-48.54~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.8.0-48-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.8.0-48-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 10: /etc/default/grub: splash: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.8.0-48-generic (--configure):
 installed linux-image-5.8.0-48-generic package post-installation script subprocess retu
rned error exit status 1
Processing triggers for linux-image-5.8.0-44-generic (5.8.0-44.50~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.8.0-44-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.8.0-44-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 10: /etc/default/grub: splash: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.8.0-44-generic (--configure):
 installed linux-image-5.8.0-44-generic package post-installation script subprocess retu
rned error exit status 1
Errors were encountered while processing:
 grub-pc
 linux-image-5.8.0-48-generic
 linux-image-5.8.0-44-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

并且在运行时sudo apt-get upgrade

Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-5.8.0-41-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 9,748 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 418768 files and directories currently installed.)
Removing linux-image-5.8.0-41-generic (5.8.0-41.46~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.8.0-41-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 10: /etc/default/grub: splash: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.8.0-41-generic (--remove):
 installed linux-image-5.8.0-41-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.8.0-41-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

输出df-h

tmpfs           767M  2.2M  765M   1% /run
/dev/sda2       916G  264G  605G  31% /
tmpfs           3.8G     0  3.8G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/loop1       56M   56M     0 100% /snap/core18/1997
/dev/loop0      185M  185M     0 100% /snap/blender/65
/dev/loop4       56M   56M     0 100% /snap/core18/1988
/dev/loop2       70M   70M     0 100% /snap/cherrytree/28
/dev/loop5       52M   52M     0 100% /snap/snap-store/518
/dev/loop6      273M  273M     0 100% /snap/telegram-desktop/2551
/dev/loop3       33M   33M     0 100% /snap/snapd/11107
/dev/loop7      2.3M  2.3M     0 100% /snap/gnome-system-monitor/157
/dev/loop8      219M  219M     0 100% /snap/gnome-3-34-1804/66
/dev/loop9      244M  244M     0 100% /snap/fakecam/102
/dev/loop13     2.3M  2.3M     0 100% /snap/gnome-system-monitor/148
/dev/loop12      76M   76M     0 100% /snap/discord/121
/dev/loop10     240M  240M     0 100% /snap/zoom-client/136
/dev/loop16     157M  157M     0 100% /snap/code/59
/dev/loop15     100M  100M     0 100% /snap/core/10908
/dev/loop14     241M  241M     0 100% /snap/zoom-client/138
/dev/loop17      65M   65M     0 100% /snap/gtk-common-themes/1513
/dev/loop11      21M   21M     0 100% /snap/ubuntu-make/845
/dev/loop19     162M  162M     0 100% /snap/gnome-3-28-1804/128
/dev/loop21      21M   21M     0 100% /snap/ubuntu-make/851
/dev/loop18     199M  199M     0 100% /snap/flutter/62
/dev/loop20      62M   62M     0 100% /snap/core20/904
/dev/loop22     398M  398M     0 100% /snap/datagrip/101
/dev/loop26      77M   77M     0 100% /snap/discord/122
/dev/loop24      33M   33M     0 100% /snap/snapd/11402
/dev/loop27     139M  139M     0 100% /snap/chromium/1514
/dev/loop23     244M  244M     0 100% /snap/fakecam/104
/dev/loop25     218M  218M     0 100% /snap/gnome-3-34-1804/60
/dev/loop29     163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop31      62M   62M     0 100% /snap/core20/875
/dev/loop28      52M   52M     0 100% /snap/snap-store/498
/dev/loop34     256K  256K     0 100% /snap/gtk2-common-themes/13
/dev/loop32     188M  188M     0 100% /snap/blender/111
/dev/loop35     139M  139M     0 100% /snap/chromium/1523
/dev/loop30      43M   43M     0 100% /snap/leafpad/79
/dev/loop37      65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/loop39     199M  199M     0 100% /snap/flutter/56
/dev/loop36     153M  153M     0 100% /snap/code/58
/dev/loop33     395M  395M     0 100% /snap/datagrip/100
/dev/loop38     273M  273M     0 100% /snap/telegram-desktop/2480
/dev/loop40     100M  100M     0 100% /snap/core/10859
/dev/sda1       511M  7.9M  504M   2% /boot/efi
tmpfs           767M   16K  767M   1% /run/user/125
tmpfs           767M   36K  767M   1% /run/user/1000

我目前正在使用5.8.0-43-generic

上面的链接只是一些解决方案,我已经尝试了很多,但都没有用,我想也许是硬件问题。

无论我尝试什么都没有用,我无法更新我的系统,无法设置我的 SSD,我无法使用 apt 或 apt-get 做任何事情。

如果需要更多信息,请告诉我,我会积极主动,因为这对我来说是一个重要的问题,除非我解决这个问题,否则我无法恢复我的项目工作。

答案1

用户535733指出了错误的根源,我在这里找到了解决方案:Ubuntu – Grub 错误:/usr/sbin/grub-mkconfig

/etc/default/grub应用解决方案之前的输出。

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="lsb_release -i -s 2> /dev/null || echo Debian"

GRUB_CMDLINE_LINUX_DEFAULT=“GRUB_CMDLINE_LINUX_DEFAULT=quiet splash acpi_os_name=Linux acpi_osi=! acpi_osi=Linux acpi_backlight=vendor modprobe.blacklist=nouveau“
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

line 11默认写了一个花哨的双引号“TEXT GOES HERE“

我不得不将其删除并用普通双引号替换它"TEXT GOES HERE"

/etc/default/grub应用解决方案后的输出。

# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="lsb_release -i -s 2> /dev/null || echo Debian"

GRUB_CMDLINE_LINUX_DEFAULT="GRUB_CMDLINE_LINUX_DEFAULT=quiet splash acpi_os_name=Linux acpi_osi=! acpi_osi=Linux acpi_backlight=vendor modprobe.blacklist=nouveau"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

运行后输出sudo update-grub

Sourcing file /etc/default/grub.d/init-select.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-48-generic
Found initrd image: /boot/initrd.img-5.8.0-48-generic
Found linux image: /boot/vmlinuz-5.8.0-44-generic
Found initrd image: /boot/initrd.img-5.8.0-44-generic
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Adding boot menu entry for UEFI Firmware Settings
done

之后,我的所有 apt 和 apt-get 命令都起作用了。

相关内容