尝试使用 yannubuntu 的 Boot Repair Disk 修复损坏的 ubuntu 安装时,加载共享库 libtinfo.so.5 时出错

尝试使用 yannubuntu 的 Boot Repair Disk 修复损坏的 ubuntu 安装时,加载共享库 libtinfo.so.5 时出错

我无法通过 chroot 重新安装 grub,每次尝试重新安装时都会出现以下错误。

加载共享库时出错:libtinfo.so.5:无法打开共享对象文件:没有此文件或目录

一点背景故事: 最近,当我尝试将磁盘分区从 MBR 转换为 GPT 时,我的 Ubuntu 安装失败了。使用以下命令重新启动后,sgdisk -g /dev/sda我无法启动 Ubuntu!

我的主要目标是将 MBR LVM 分区转换为 GPT,以便安装 Windows 10。我原以为必须将其更改为 GPT 才能安装 Windows 10,但后来发现,只需使用 KDE 分区管理器或任何其他能够进行 LVM 操作的工具调整分区大小,然后将分区格式化为 NTFS,就可以让环境为安装 Windows 10 做好准备。

现在的问题: 虽然我已经设法让 Windows 10 运行,并且现在从中输入内容,但我陷入了有点困境,我喜欢使用 Ubuntu Linux,并且我想要一个双启动设置,Windows 用于多媒体和游戏,而 Ubuntu Linux 作为日常操作系统!

我偶然发现了一个由 yannubuntu 开发的名为启动修复盘的软件源码,我在 USB 驱动器上启动它,然后运行启动修复软件,它要求我执行以下命令,sudo chroot "/mnt/boot-sav/mapper/vgubuntu-root" apt purge --allow-remove-essential -y grub*-common shim-signed以便使用 chroot 在 Ubuntu LVM 分区上重新安装和配置 grub。

当我执行此命令时,我总是收到此库错误,/bin/bash: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory dpkg: error processing package grub-pc (--remove):即使库已安装在启动修复磁盘中,正如我在尝试使用 apt 安装它时发现的那样,并且我假设它已在 Ubuntu 中预安装,并且库已存在于启动修复磁盘中并且它基于 Ubuntu。

这是我的问题的完整终端视图,可以在这里看到执行的命令和上述错误。

Command:
sudo chroot "/mnt/boot-sav/mapper/vgubuntu-root" apt purge --allow-remove-essential -y grub*-common shim-signed

Output:
lubuntu@lubuntu:~$ sudo chroot "/mnt/boot-sav/mapper/vgubuntu-root" apt purge --allow-remove-essential -y grub*-common shim-signed
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'grub-common' for glob 'grub*-common'
Note, selecting 'grub2-common' for glob 'grub*-common'
Package 'shim-signed' is not installed, so not removed
The following packages will be REMOVED:
  grub-common* grub-gfxpayload-lists* grub-pc* grub-pc-bin* grub2-common*
0 upgraded, 0 newly installed, 5 to remove and 73 not upgraded.
2 not fully installed or removed.
After this operation, 18.8 MB disk space will be freed.
(Reading database ... 305827 files and directories currently installed.)
Removing grub-pc (2.04-1ubuntu26.12) ...
/bin/bash: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
dpkg: error processing package grub-pc (--remove):
 installed grub-pc package pre-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
/bin/bash: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
dpkg: error while cleaning up:
 installed grub-pc package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 grub-pc
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

请帮帮我,我陷入困境了,不知道下一步该怎么办!

谢谢!

注意:我已经尝试过的一些方法:

  1. 尝试使用 USB 上完整版 Ubuntu 18.04 的 chroot 在变砖的 Ubuntu 上重新安装 grub,但同样的库错误仍然存​​在

答案1

在我的例子中,问题在于 libtinfo.so.6 被放在文件夹“lib64”中。将其放在“lib”中即可解决。

(我在 /bin/bash 上运行 chroot)

sudo chroot $HOME/jail /bin/bash

相关内容