3

I installed ImageMagick via apt install imagemagick but then realised I need a newer version, so I compiled it from source and installed over the top of the old version. mogrify -version still showed the old version so I decided to remove everything and start again from scratch with apt remove imagemagick. However even after this I can still run imagemagick; i.e. it's not removed.

How can I remove it properly?

(And why did this happen in the first place? Why does apt remove not work?)

enter image description here

Related question: What is simplest process to get ImageMagick 7 with PNG support on Ubuntu?

Clonkex
  • 1,654
  • 1
    Wrong question. The right question to ask is "Why do I have 276 packages not upgraded? Why is my Ubuntu system not upgrading?" – user535733 Mar 12 '20 at 01:19
  • @user535733 ? What do you mean? Also I find the tone of your question a bit insulting. Please don't bother commenting if you're not going to be helpful. – Clonkex Mar 12 '20 at 02:15
  • No insult is intended. Your output indicates a different problem more serious than one package that us maybe-or-not installed. I gently suggest you fix the other one first. The rest of your question doesn't seem to indicate anything wrong so far - you wrote that you replaced a package with a compiled version...and it works. That's expected behavior. Um, note that apt will ONLY remove debs. Apt cannot remove (and does not know about) software that you compile. – user535733 Mar 12 '20 at 02:28
  • @user535733 What is the problem? I don't use Linux normally. What does 276 packages not upgraded mean? Also, I don't know what "debs" are but WHAT. Apt won't remove stuff I've compiled?? Well THAT is a critical piece of info. Why has no one else told me this? Thank you for at least explaining that. Some things make much more sense now. How would I remove it then, if I've compiled it? I still want to get rid of the newer version. – Clonkex Mar 12 '20 at 02:31
  • Uninstall: Check your original source code's README or INSTALL files. Those usually have quite good uninstall instructions. If not, then you must delete each file by hand, which can be tedious. Upgrade Problems: Probably better as a different Question - the troubleshooting can get involved. – user535733 Mar 12 '20 at 02:40
  • @user535733 Separate question? What would I ask though? "Someone told me 276 upgrades is a bad thing"? You seem to think I know why that's a problem, but as far as I know it's not relevant to this question and I haven't had any other issues with the system so why do I care that it says 276 upgrades? – Clonkex Mar 12 '20 at 02:47
  • It matters because you are not getting security patches, critical bugfixes, etc. Run sudo apt update then run sudo apt upgrade. Show the output of the latter. – user535733 Mar 12 '20 at 03:00
  • @user535733 Oh wait, upgrades are updates? Well I didn't know that. Why would they call them upgrades? That makes it sound like some major feature update or something. Literally everywhere else they're called updates. But also this is a VM that exists exclusively for the purpose of running imagemagick on images, so I don't really care about how healthy it is as long as it works. – Clonkex Mar 12 '20 at 03:02
  • Okay then. Last word: apt updates your local database of available packages, then upgrades any packages with upgrades available. That's the difference. – user535733 Mar 12 '20 at 03:05

1 Answers1

4

The imagemagick package is a dummy package. From apt show imagemagick

 .
 This package include links to channel depth specific binaries and manual
 pages.
 .
 This is a dummy package.  You can safely purge or remove it.

The "channel depth specific binaries and manual pages" are provided by the package's dependency - you can check what that is using apt depends - for example:

$ apt depends imagemagick
imagemagick
  Depends: imagemagick-6.q16 (>= 8:6.9.2.10+dfsg-2~)
    imagemagick-6.q16:i386

(the q16 here refers to the the channel depth). If you installed imagemagick via apt (or apt-get) this will be the package that you need to remove.

If you installed the software by building it from source code, then please refer to

steeldriver
  • 136,215
  • 21
  • 243
  • 336
  • The problem is, when I do apt depends imagemagick I get exactly the same output you get, yet after doing apt remove imagemagick-6.q16 I can still do magick -version and doing apt depends imagemagick still gives me the same output. Nothing changes after removeing anything to do with imagemagick except that now apt tells me I can't remove it any more because it's not installed. I don't understand what's wrong. – Clonkex Mar 12 '20 at 02:13
  • @Clonkex what does type -a magick say? – steeldriver Mar 12 '20 at 02:29
  • magick is /usr/local/bin/magick – Clonkex Mar 12 '20 at 02:32
  • 1
    @Clonkex so that is a version that would have been installed by other means (from a 3rd party package, or built from source). You won't be able to use the normal package management tools to remove it. – steeldriver Mar 12 '20 at 02:35
  • Well I did say in my question that I built from source, but how did you figure it out from my last comment? What told you that? I don't use Ubuntu for much so I have no idea. And yeah, someone in the comments on my question informed me (in a roundabout kind of way) that apt won't remove built-from-source packages. I guess I assumed it worked like Windows, where pretty much anything that you install is registered with Windows and you can initiate the uninstall from Windows. And you know, make install sounds a lot like I'm installing it normally. – Clonkex Mar 12 '20 at 03:11
  • @Clonkex I figured it out based on the path - AFAIK no official Ubuntu package installs stuff to /usr/local – steeldriver Mar 12 '20 at 03:14
  • Right, thank you. I just discovered that there's a text document in the source folder that gives some more information on configuring and installing imagemagick, and also mentions I can do make uninstall to remove it (which worked). If you want to include something along those lines in your answer (which covers most of my original problem, but not how to remove imagemagick when it was built from source) I will accept it :) – Clonkex Mar 12 '20 at 03:19
  • 1
    @Clonkex please see edit – steeldriver Mar 12 '20 at 03:27