LoginSignup
8

More than 5 years have passed since last update.

共有ライブラリの依存関係のエラー `cannot open shared object file: No such file or directory`

Posted at

試した環境

  • CentOS6.5

今回は、Linux環境でとあるパッケージをYumでインストールした際にそのコマンドが使えなかった。汎用的に同エラーが出た際にも対応出来るような手順で解決した。

ogrinfoを使うときに以下のエラーが出た :sweat_smile:

ogrinfo: error while loading shared libraries: 
libhdf5.so.6: cannot open shared object file: No such file or directory

yumでまずは依存関係を調べる :neutral_face:

yum search \*/libhdf5.so.6
yum provides \*/libhdf5.so.6

yum providesででてきたパスから先ほどのlibhdf5.so.6をgrepかけてみる

libhdf5系のライブラリがどこに入っているかわかった :notes:

ll /usr/lib64/openmpi/lib/ | grep "libhdf5*"
/sbin/ldconfig -p | grep "libhdf5*"

実際に読み込まれているものは以下で分かります

cat /etc/ld.so.conf

/etc/ld.so.conf.d/直下のコンフィグファイルを読み取っているので

libhdf5.so.6を追加しておく :grinning: :frog:

echo "/usr/lib64/openmpi/lib" >/etc/ld.so.conf.d/ogrinfo.conf

共有ライブラリの依存関係情報が格納されたライブラリキャッシュを更新しましょう :ghost:

/sbin/ldconfig

done :thumbsup:

一つづつ解決していくことで下手にググるよりもいいでしょう

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8