损坏的内核不允许我做任何事情

损坏的内核不允许我做任何事情

好吧,我昨天问了一个关于我的流行操作系统无法识别任何驱动程序的问题。经过大量搜索后,我发现我的内核 6.2.6 安装不完整。但现在它运行 6.2.6 作为默认或主要版本。在6.2.6内核中所有包下载都不成功。我能够使用启动菜单加载到以前的内核。当我按带有徽标的 esc 时,它会询问 windows 或 pop 操作系统,但如果我在 2-3 秒后立即按 esc ,它会询问旧内核或新内核。所以我能够进入以前工作正常的内核。

(base) madhusudan@pop-os:~$ uname -r
6.1.11-76060111-generic 

(base) madhusudan@pop-os:~$ dpkg --list | grep linux-image                                                
ii  linux-image-6.0.12-76060006-generic       6.0.12-76060006.202212290932~1674139725~22.04~ca93ccf    amd64   Linux kernel image for version 6.0.12 on 64 bit x86 SMP                                                                            
ii  linux-image-6.1.11-76060111-generic       6.1.11-76060111.202302091138~1675975749~22.04~f771a7f    amd64   Linux kernel image for version 6.1.11 on 64 bit x86 SMP                                                                             
iF  linux-image-6.2.6-76060206-generic        6.2.6-76060206.202303130630~1683753207~22.04~77c1465     amd64   Linux kernel image for version 6.2.6 on 64 bit x86 SMP                                                                
ii  linux-image-generic                       6.2.6.76060206.202303130630~1683753207~22.04~77c1465     amd64   Generic Linux kernel image

如果我尝试删除旧内核,它不起作用

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pop-desktop : Depends: linux-system76 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

不满足 linux-system76 依赖性,所以我尝试安装它

linux-system76 is already the newest version (6.2.6.76060206.202303130630~1683753207~22.04~77c1465).
The following packages were automatically installed and are no longer required:
  linux-headers-6.0.12-76060006 linux-headers-6.0.12-76060006-generic
  linux-image-6.0.12-76060006-generic linux-modules-6.0.12-76060006-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
1 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-6.2.6-76060206-generic (6.2.6-76060206.202303130630~1683753207~22.04~77c1465) ...
Processing triggers for linux-image-6.2.6-76060206-generic (6.2.6-76060206.202303130630~1683753207~22.04~77c1465) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.2.6-76060206-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.6-76060206-generic
kernelstub.Config    : INFO     Looking for configuration...
kernelstub.Drive     : ERROR    Could not find a block device for the a partition. This is a critical error and we cannot continue.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kernelstub/drive.py", line 56, in __init__
    self.esp_fs = self.get_part_dev(self.esp_path)
  File "/usr/lib/python3/dist-packages/kernelstub/drive.py", line 94, in get_part_dev
    raise NoBlockDevError('Couldn\'t find the block device for %s' % path)
kernelstub.drive.NoBlockDevError: Couldn't find the block device for /boot/efi
run-parts: /etc/initramfs/post-update.d//zz-kernelstub exited with return code 174
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.2.6-76060206-generic (--configure):
 installed linux-image-6.2.6-76060206-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-6.2.6-76060206-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

它说找不到块设备,我不知道该怎么办。因为现在默认情况下它仍然加载损坏的内核,并且不允许我安装任何内容,即使在旧内核中也是如此

答案1

我使用问题中提到的方法登录到旧内核。然后我升级了它。所有必需的文件已下载,但未安装,因为找不到 efi 分区。所以我在 /etc/fstab 文件中引起了一个错误,在重新启动后,由于该错误,我进入了紧急模式。这里我安装了下载的包并且运行成功。然后我解决了我用来进入紧急模式的错误。然后我重新启动。 6.2.6 内核已加载,现在可以完美运行

之后还使用检查可恢复和损坏的文件

sudo sh -c 'fsck.vfat -n /dev/[partition name] || echo "RECOVERABLE errors found"'

如果有损坏的文件运行

sudo fsck.vfat -a /dev/[partition name]

相关内容