I've got an embedded device running without monitor, running Debian Jessie. Since I don't need a UI, I considered cleaning up the X11 packages. This gave a somewhat unexpected result:

 sudo -u nobody apt-get remove '^x11' -s 

This produces the following result:

The following packages will be REMOVED: ffmpeg libavdevice57 libavfilter6 ... libx11-dev libxau-dev ...

The ffmpeg that would be removed is this version from jessie-backports. That was not intended. The libx11-dev strictly speaking doesn't match '^x11' but I can explain that as an automatically installed package being auto-removed. But ffmpeg is manually installed (as confirmed by apt-mark showmanual).

What is the link between packages named ^x11 and ffmpeg that causes this?

I've also tried sudo -u nobody apt-get remove '^vnc' -s and sudo -u nobody apt-get autoremove Neither affects ffmpeg; it's not some orphan package that gets auto-removed regardless. It is specifically tied to X11.

  • 2
    To remove X server packages, you should apt remove ^xorg, not ^x11. (Removing some of ^x11 makes sense, but not all of them.) – Stephen Kitt Oct 26 '17 at 12:59

I haven't traced the complete dependency tree, but the linked package has at least the following chain of dependencies: ffmpeg depends on libsdl2, which in turn depends on libxss1, which in turn depends on x11-common.

Since x11-common matches ^x11, it is removed, breaking a dependency of ffmpeg. Thus, ffmpeg has to be removed. Assuming this is the only such chain, you should be able to keep ffmpeg by ensuring that x11-common is not removed.

| improve this answer | |
  • How did you trace the dependencies? I can apt-mark hold x11-common but that is not sufficient. (I now get a message " The following held packages will be changed") – MSalters Oct 26 '17 at 12:15
  • @MSalters I traced the dependencies in perhaps the least efficient way possible: by clicking the links on that page. There's probably a way to do it with apt but I'm not familiar enough with Debian-based systems to know what it might be – Fox Oct 26 '17 at 12:17
  • Ok, makes sense. That SDL library indeed states that it is built with X11 support, and that does explain the X11 dependencies. It's not just x11-common, there's a whole list. Sounds like I may need to rebuild SDL for just ALSA. – MSalters Oct 26 '17 at 12:24
  • The relevant command appears to be apt-cache depends ffmpeg. Not apt-get but apt-cache, and I'm not sure how reliable it is when you deleted the package cache – MSalters Oct 26 '17 at 12:48
  • 1
    @MSalters I wouldn’t bother getting rid of all the X11 dependencies, those are just the libraries (and don’t take up that much disk space). – Stephen Kitt Oct 26 '17 at 13:17

What you're being told is only several ffmpeg libraries are being removed, because no other packages reference them.

If you do this...

apt-get install ffmpeg

Then do your remove, then these libraries will remain... maybe...

There was a certain time period when ffmpeg was (foolishly) removed from the repositories. Now thankfully it's back.

Depending on exactly what packages you're working with in Jessie will produce different results.

If you move to most recent Ubuntu, you'll have a completely different set of actions occur, because the ffmpeg poser code (my opinion) has been removed now + true/real ffmpeg now delivers again.

With Jessie, as I recall, the poser code was call aconv or something similar, so if you attempted installing ffmpeg at some points you'd either get a message saying to install aconv or ffmpeg might have been a virtual package pointing to aconv. This nonsense was all very confusing, for many years.

Just keep in mind. The APT system knows what it's doing + only removes orphan packages when they no longer have references.

So if a package is flagged for removal, then whatever the reason, the package should be removed (has no references).

| improve this answer | |
  • 1
    I understand that libavdevice57 libavfilter6 would be removed, as they are only used by ffmpeg. But the apt-get remove starts by removing ffmpeg, and that is my problem. I simply cannot find the reason - ffmpeg is not an orphan. It's manually installed, and only automatically installed packages can become orphans. I'm aware of the avconv situation, which I linked to the exact jessie-backport version of ffmpeg. – MSalters Oct 26 '17 at 12:10
  • There is no apt-get remove operation. There is apt-get autoremove, which will remove ffmpeg if ffmpeg was installed as a dependency (like via X11), then the package (like X11) is deinstalled. To have ffmpeg survive continually, you must install it via apt-get install, which will flag the package as being installed directly, rather than as a dependency. – David Favor Nov 1 '17 at 13:08
  • "There is no apt-get remove operation" ?! man apt-get disagrees with you. What you call " installed directly" is called "manually installed" by apt, and as the question states that is not sufficient to protect ffmpeg. – MSalters Nov 1 '17 at 13:21
  • Ah... My apologies... You're correct... I normally use apt-get purge, as apt-get remove leaves config files, which can cause all manner of problems if you happen to reinstall + a new install uses some old config. If you do an apt-remove of X11, the message you received about ffmpeg libraries means, they will be deleted next time you run apt-get autoremove. In other words, these libraries only get deleted when you run a specific autoremove or some tool does this for you. As I said, install the ffmpeg package to preserve ffmpeg libraries. – David Favor Nov 7 '17 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.