ブート修復ディスクを使用して壊れた Ubuntu インストールを修復しようとしたときに、共有ライブラリ libtinfo.so.5 をロード中にエラーが発生しました (yannubuntu による)

ブート修復ディスクを使用して壊れた Ubuntu インストールを修復しようとしたときに、共有ライブラリ libtinfo.so.5 をロード中にエラーが発生しました (yannubuntu による)

chroot 経由で grub を再インストールする際に問題が発生しています。再インストールしようとすると、必ず次のエラーが発生します。

共有ライブラリのロード中にエラーが発生しました: libtinfo.so.5: 共有オブジェクトファイルを開けません: そのようなファイルまたはディレクトリはありません

ちょっとした背景: 最近、ディスク パーティションを MBR から GPT に変換しようとしたところ、Ubuntu のインストールが壊れてしまいました。次のコマンドを使用して再起動すると、sgdisk -g /dev/sdaUbuntu を起動できなくなりました。

私の主な目的は、Windows 10 をインストールするために MBR LVM パーティションを GPT に変換することでした。Windows 10 をインストールするには GPT に変更する必要があると思っていましたが、後で、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-signedchroot を使用して 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

関連情報