嘗試使用 yannubuntu 的引導修復磁碟修復變磚的 ubuntu 安裝時載入共用庫 libtinfo.so.5 時出錯

嘗試使用 yannubuntu 的引導修復磁碟修復變磚的 ubuntu 安裝時載入共用庫 libtinfo.so.5 時出錯

我在透過 chroot 重新安裝 grub 時遇到問題,每當我嘗試重新安裝時都會收到以下錯誤。

載入共用程式庫時出錯:libtinfo.so.5:無法開啟共用物件檔案:沒有這樣的檔案或目錄

一點背景故事: 最近,當我嘗試將磁碟分割區從 MBR 轉換為 GPT 時,我的 Ubuntu 安裝變磚了。使用以下命令後重新啟動後,sgdisk -g /dev/sda我無法啟動到 Ubuntu!

我的主要目標是將 MBR LVM 分割區轉換為 GPT,以便安裝 Windows 10。其他能夠進行LVM 操作的工具,然後將分割區格式化為NTFS 應該可以為安裝Windows 10 做好準備。

現在的問題: 雖然我已經成功運行了 Windows 10,並且現在在其中輸入內容,但我有點墨守成規,我喜歡使用 Ubuntu Linux,我想要雙啟動設置,Windows 用於多媒體內容和遊戲,而Ubuntu Linux 成為日常操作系統!

我在 yannubuntu 上發現了一個名為啟動修復碟的軟體來源鍛造,我用 U 盤啟動它,然後運行啟動修復軟體,它要求我執行以下命令,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

相關內容