Meandering Soul

This day is done, I'm going home.
eFranes Penguin Avatar

ImageMagick with WebP Support on Ubuntu

26
Apr 2014

I recently wrote about reinstalling ImageMagick on OS X to get WebP support. A little later I was facing the same problem on an Ubuntu machine. To fix it there is also mainly just a matter of reinstalling. How to do that was explained to me here. It basically boils down to:

1
2
3
4
5
6
7
8
9
cd /tmp
mkdir imagemagick
cd imagemagick
sudo apt-get build-dep imagemagick
sudo apt-get install libwebp-dev devscripts
apt-get source imagemagick
cd imagemagick-*
debuild -uc -us
sudo dpkg -i ../*magick*.deb

Unfortunately, this does not take into consideration that one might run apt-get upgrade at some point in the future again and that this upgrade operation might overwrite the just painfully compiled webp supporting ImageMagick package. Luckily, there is a simple fix for that. Apt allows packages to be blacklisted from future operations. The list of these is contained in /etc/apt/apt.conf.d/01autoremove.conf. In order to keep the compiled version of the package all one needs to do is to add imagemagick* in the Never-MarkAuto-Sections, e.g. something like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
APT
{
...
 Never-MarkAuto-Sections
 {
    "metapackages";
    "restricted/metapackages";
    "universe/metapackages";
    "multiverse/metapackages";
    ...
    "imagemagick*";
 };
};
  • Published on April 26, 2014
  • 181 words