libxml2.so.2: 共有オブジェクトファイルを開けません。そのファイルやディレクトリはありません。

libxml2.so.2: 共有オブジェクトファイルを開けません。そのファイルやディレクトリはありません。

誤ってlibxml2を削除したCentOSを使用していましたが、次のエラーが表示されます。

There was a problem importing one of the Python modules required to
run yum. The error leading to this problem was:

libxml2.so.2: cannot open shared object file: No such file or
directory

Please install a package which provides this module, or verify that
the module is installed correctly.

It's possible that the above module doesn't match the current version
of Python, which is: 2.4.3 (#1, Jun 18 2012, 08:55:31) [GCC 4.1.2
20080704 (Red Hat 4.1.2-52)]

If you cannot solve this problem yourself, please go to the yum faq
at: http://wiki.linux.duke.edu/YumFaq

ベストアンサー1

まずhttp://vault.centos.org/。使用しているCentOSのバージョンとアーキテクチャを見つけてlibxml2 rpmのコピーをダウンロードします(たとえば、フルパスは次のようになります)。http://vault.centos.org/4.1/os/i386/CentOS/RPMS/libxml2-2.6.16-6.i386.rpm)。

ダウンロードしたら、次のコマンドを使用してインストールしますrpm

# rpm -i libxml2-2.6.16-6.i386.rpm

おすすめ記事