ImageMagick / ImageMagick

🧙‍♂️ ImageMagick 7
https://imagemagick.org
Other
12.2k stars 1.36k forks source link

Error trying to load shared library libtiff.so.5 #7597

Closed 5dma closed 1 month ago

5dma commented 1 month ago

ImageMagick version

7.x.x.x (not sure)

Operating system

Linux

Operating system, version and so on

Ubuntu 24.04.1 LTS (noble)

Description

I upgraded my Ubuntu from 22.04 to 24.04 a few days ago. Since then I get an error when trying to invoke magick.

Steps to Reproduce

Open a shell. Type magick --version. Response is

magick: error while loading shared libraries: libtiff.so.5: cannot open shared object file: No such file or directory

Also attached is the response to dpkg -l | grep -i magick.

ii  imagemagick                                        8:6.9.12.98+dfsg1-5.2build2              amd64        image manipulation programs -- binaries
ii  imagemagick-6-common                               8:6.9.12.98+dfsg1-5.2build2              all          image manipulation programs -- infrastructure
ii  imagemagick-6.q16                                  8:6.9.12.98+dfsg1-5.2build2              amd64        image manipulation programs -- quantum depth Q16
rc  libimage-magick-perl                               8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5+esm1 all          Perl interface to the ImageMagick graphics routines
ii  libmagick++-6.q16-9t64:amd64                       8:6.9.12.98+dfsg1-5.2build2              amd64        C++ interface to ImageMagick -- quantum depth Q16
ii  libmagickcore-6-arch-config:amd64                  8:6.9.12.98+dfsg1-5.2build2              amd64        low-level image manipulation library - architecture header files
ii  libmagickcore-6-headers                            8:6.9.12.98+dfsg1-5.2build2              all          low-level image manipulation library - header files
ii  libmagickcore-6.q16-7-extra:amd64                  8:6.9.12.98+dfsg1-5.2build2              amd64        low-level image manipulation library - extra codecs (Q16)
ii  libmagickcore-6.q16-7t64:amd64                     8:6.9.12.98+dfsg1-5.2build2              amd64        low-level image manipulation library -- quantum depth Q16
ii  libmagickwand-6-headers                            8:6.9.12.98+dfsg1-5.2build2              all          image manipulation library - headers files
ii  libmagickwand-6.q16-7t64:amd64                     8:6.9.12.98+dfsg1-5.2build2              amd64        image manipulation library -- quantum depth Q16

Thank you.

Images

shell

fmw42 commented 1 month ago

What were you install commands? Where did you get the installation? Was it binary or source?

5dma commented 1 month ago

Install commands: I followed the Xubuntu upgrade procedure. I tried it twice, below is my second attempt.

sudo apt update
sudo apt full-upgrade
sudo apt install --reinstall xubuntu-desktop^

Repositories The repositories I'm retrieving from are

$ apt-cache policy | grep origin
origin security.ubuntu.com
origin us.archive.ubuntu.com
origin esm.ubuntu.com

Binary or source Not sure--I believe binary. When I try to compile a simple program with gcc, I get a similar message.

$ gcc `pkg-config --cflags MagickWand` main.c `pkg-config --libs MagickWand`
/usr/bin/ld: warning: libtiff.so.5, needed by /usr/local/lib/libMagickCore-7.Q16HDRI.so, not found (try using -rpath or -rpath-link)
fmw42 commented 1 month ago

Sorry, I thought you were installing only Imagemagick, not Ubuntu.

You have Imagemagick 6 installed, not Imagemagick 7. So you need to use convert and not magick as the imagemagick command.

Try

convert -version

Does that works properly without error?

5dma commented 1 month ago

Same result.

$ convert -version
convert: error while loading shared libraries: libtiff.so.5: cannot open shared object file: No such file or directory
fmw42 commented 1 month ago

Sorry, I am not a Linux expert. So one of the IM developers will need to comment further.

snibgo commented 1 month ago

error while loading shared libraries: libtiff.so.5

I know nothing about Linux, but I will ask the obvious question: have you installed libtiff?

libtiff is not a requirement for ImageMagick (IM). But by default, IM is built with tiff support, which needs libtiff. If you don't want tiff support, use --without-tiff in ./configure when building IM.

fmw42 commented 1 month ago

snibgo, he did not install imagemagick. He installed Linux from what I understand, which comes with Imagemagick.

urban-warrior commented 1 month ago

Try this command:

sudo apt install libtiff5
5dma commented 1 month ago
$ sudo apt install libtiff5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libtiff5

Although I do have libtiff6 installed from the Ubuntu repository. Thank you all for your comments. I'll pursue with the Ubuntu folks.

oyontalas commented 1 month ago

A rough solution is to copy a libtiff.so.5.7.0file from an Ubuntu22 system, put it in the /usr/lib/x86_64-linux-gnu folder of the Ubuntu24 system, and then create a soft link libtiff.so.5. I don't know if there will be any hidden problems. The command is:

sudo cp libtiff.so.5.7.0 /usr/lib/x86_64-linux-gnu
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libtiff.so.5.7.0 libtiff.so.5

Note that I have not fully tested it, please operate with caution.

5dma commented 1 month ago

Thank you, @oyontalas.

The embarrassing resolution to this issue is at Ask Ubuntu, ImageMagick missing libtiff.so.5 after upgrade to 24.04. I inadvertently left a symbolic link or executable somewhere that was masking the upgraded version of ImageMagick.

dlemstra commented 1 month ago

Thanks for coming back here and explaining how you solved this.