无法安装 Image::Magick,即使已安装 Image Magick

无法安装 Image::Magick,即使已安装 Image Magick

我正在尝试找出 Image::Magick 无法安装的原因。我尝试了很多方法,但仍然无法安装:

perl -MCPAN -e 'install Image::Magick'

...然后它就消失了:

Reading '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.cpan/Metadata
Running install for module 'Image::Magick'
Fetching with LWP:
http://www.cpan.org/authors/id/J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz
Fetching with LWP:
http://www.cpan.org/authors/id/J/JC/JCRISTY/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json
  JCRISTY/PerlMagick-6.89-1.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz
cp Magick.pm blib/lib/Image/Magick.pm
AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick)
Running Mkbootstrap for Image::Magick ()
chmod 644 "Magick.bs"
"/usr/bin/perl" "/usr/share/perl/5.22/ExtUtils/xsubpp"  -typemap "/usr/share/perl/5.22/ExtUtils/typemap" -typemap "typemap"  Magick.xs > Magick.xsc && mv Magick.xsc Magick.c
x86_64-linux-gnu-gcc -c  -I/usr/local/include/ImageMagick-6 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libxml2 -I"/usr/include/ImageMagick-6" -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/freetype2 -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -O2 -g   -DVERSION=\"6.89\" -DXS_VERSION=\"6.89\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.22/CORE"  -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
In file included from /usr/include/ImageMagick-6/magick/MagickCore.h:29:0,
                 from Magick.xs:60:
/usr/include/ImageMagick-6/magick/magick-config.h:21:38: fatal error: magick/magick-baseconfig.h: No such file or directory
compilation terminated.
Makefile:350: recipe for target 'Magick.o' failed
make: *** [Magick.o] Error 1
  JCRISTY/PerlMagick-6.89-1.tar.gz
  /usr/bin/make -- NOT OK

事实上,它似乎确实存在:

root@admin:~# locate magick-baseconfig.h
/usr/include/x86_64-linux-gnu/ImageMagick-6/magick/magick-baseconfig.h

有什么想法可以尝试吗?我尝试过以下方法:

apt-get install libmagickcore-dev

..但没有快乐。

答案1

我的建议是,当您的发行版也以普通软件包的形式提供模块时,避免使用 CPAN 从源代码安装模块。使用普通软件包可以让您从发行版提供的依赖管理、定期安全更新和安全修复中受益,并且配置管理也更加一致。

对于 Debian 和 Ubuntu 来说,这将是libimage-magick-perl软件包(对于 RHEL CentOS,等效于ImageMagick-perl

apt-get install libimage-magick-perl

相关内容