安裝 ImageMagick 後執行指令出現:
./tests: error while loading shared libraries: xxx.so.0: cannot open shared object file: No such file or directory
表示動態連結器找不到共用函式庫位置。
vim /etc/ld.so.conf加入函式庫路徑(通常為
/usr/local/lib):
/usr/local/lib
/sbin/ldconfig -v此步驟必須執行,否則設定不生效。
convert -version應正常顯示版本資訊。
ld.so.conf 定義動態連結器搜尋共用函式庫(.so 檔)的目錄。ldconfig 會掃描這些目錄,建立 /etc/ld.so.cache 快取檔供執行階段快速查找。
portaudio 函式庫,透過套件管理器安裝對應 -libs 套件libsm6 或對應開發套件apt install imagemagick、yum install ImageMagick),自動處理依賴./configure --prefix=/usr/local 並確保 /usr/local/lib 在 ld.so.conf 中Dockerfile 中執行 ldconfig