How to remove ImageMagick without breaking its dependencies?

5,119

Solution 1

ImageMagick is a suite of command line tools and libraries for working with images and packages that depend on it or uses parts of it to function.

Cups uses it for its filters and while it's possible that you don't use any filters that use ImageMagick, I'd recommend that you keep it, because removing it may break Cups.

Now, if you still want to remove it, you can do it like this:

$ sudo dpkg --purge --force-all imagemagick

Note: This will very likely break your system so don't do it!

Solution 2

Some functionality of the dependent packages depend on ImageMagick by definition. This means that the dependent packages (cups etc.) have been built in a way that they require (depend on) ImageMagick to complete certain operations.

So, without a working ImageMagick, cups built by Ubuntu will not work as intended. To make sure all the installed packages work as intended, apt, dpkg and other system tools make sure the packages with unsatisfied dependencies will be deleted from the system.

If you still are certain you don't need ImageMagick on your system, you will have to compile cups and other dependent packages again without linking them against or making them otherwise dependent on ImageMagick. That may or may not be possible using parameters to compilation configuration script (usually invoked by ./configure command). In Ubuntu, maintaining self-built packages is usually not recommended or made particularly easy (you will have to compile the applications again manually to update them, and make sure the applications' dependant packages are compiled again, too).

The practical solutions are using a distribution where self-building applications and handling dependencies across them is meant to be easier for the end-user (Gentoo, Arch, etc.), and alternatively keep using Ubuntu without deleting ImageMagick.

Share:
5,119

Related videos on Youtube

Neni
Author by

Neni

I prefer to operate from within the shadows...

Updated on September 18, 2022

Comments

  • Neni
    Neni over 1 year

    I want to remove the pre-installed ImageMagick from my Ubuntu 16.04 LTS. Uninstalling it also removes CUPS and other dependent packages which I want to keep on my system.

    Is there a way to remove only ImageMagick without harming its dependencies or without having to reinstall them after their auto-removal?

    • Raniz
      Raniz almost 8 years
      What's the reason behind removing imagemagick?
    • Neni
      Neni almost 8 years
      I don't want it, I don't need it and it can't be launched. I guess it's a command line tool only, but there are two .desktop-files in the dashs applications section. I want to keep cups and a few other dependent packages without having to reinstall them after removing ImageMagick.
    • Admin
      Admin almost 8 years
      so, basically, you want to remove the wheels from your car, because you don't use them directly, but want to still leave a fully functional car behind?
    • Eliah Kagan
      Eliah Kagan over 7 years
      Related: Bug 1562560