After various linux beginner's experiments my Kubuntu system keeps telling me that there are unused packages that are not needed anymore and that should be removed. This sounds like a good idea to me.

This is what "apt-get -s autoremove" proposes for removal:

  freeglut3 fs-uae fs-uae-launcher gir1.2-gtksource-3.0 hwdata ipython kmymoney-common libalkimia4 libexosip2-11 libglee0d1 libgnome-desktop-2-17 libgtksourceview-3.0-1 libgtksourceview-3.0-common
  libgwengui-cpp0 libgwengui-qt4-0 liblinphone5 libmediastreamer-base3 libofx6 libosip2-11 libosp5 libpanel-applet0 libportmidi0 libpyside1.2 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0
  libsensors-applet-plugin0 libshiboken1.2 libsmpeg0 linux-headers-3.19.0-15 linux-headers-3.19.0-15-generic linux-image-3.19.0-15-generic linux-image-extra-3.19.0-15-generic meld python-dulwich
  python-fastimport python-numpy python-opengl python-pexpect python-pygame python-pyside python-pyside.phonon python-pyside.qtcore python-pyside.qtdeclarative python-pyside.qtgui python-pyside.qthelp
  python-pyside.qtnetwork python-pyside.qtopengl python-pyside.qtscript python-pyside.qtsql python-pyside.qtsvg python-pyside.qttest python-pyside.qtuitools python-pyside.qtwebkit python-pyside.qtxml
  python-simplegeneric python-svn

For most of them I have no idea in which context I installed them. But at least one of these packages is definitely NOT unused: The emulator "fs-uae" was manually installed by me and I intend to continue using it.

Why does apt-get propose to remove the "fs-uae" package? Is there a way to cleanup with breaking anything and without removing something I need?

  • First, look in /var/log/apt/history.log whether you have not accidentally removed a package that depended on these packages. (You can do something like grep remove /var/log/apt/history.log). You may need to go back into history.log.1.gz if the history log is too recent. Anyway it should be safe to do an autoremove and then reinstall fs-uae. – Jos Sep 20 '15 at 21:32
  • Ok, I will look into that log. But I am pretty sure that FS-Uae was not installed by any dependency. I installed it directly using Muon. And what about packages I missed like "meld"... I installed it on purpose too but missed it due to the length of the above list. And there is "liblinphone5"... how can I make sure it isn't needed by linphone which I installed manually and that is still needed too? – Silicomancer Sep 20 '15 at 21:47
  • liblinphone5 is indeed needed by linphone, as you can see by running apt-cache depends linphone. Something strange is going on; I now see that Gnome 2.17 is about to be uninstalled, which is not what I would expect in any Kubuntu system. Proceed with caution. – Jos Sep 20 '15 at 21:52
  • Oh my... that is what a Linux rookie wants to hear ;-) When I enter "apt-cache depends linphone" it tells me that the actual dependency is "liblinphone7". So removing version 5 seems no mistake. But "fs-uae" and "fs-uae-launcher" are very strange. What could I need gnome for? – Silicomancer Sep 20 '15 at 22:04
  • 1
    possible duplicate of Uninstalling Dependencies. Is This a Good Practice? – Pilot6 Sep 20 '15 at 22:12

As you probably already know, in Linux packages may specify "dependencies", that is other packages that must be installed in order for this package to actually work. These dependencies are resolved recursively, that is dependencies of your package dependencies are installed as well. This way meta-packages may exist that will install entire set of software. Common examples are libreoffice (for office suite) or kde-full for entire KDE desktop.

When apt (Debian package manager) installs some package, it marks all dependencies as automatically installed. This way it can distinguish between packages explicitly requested by user and packages that were pulled in merely as dependencies (about which user most likely don't care at all).

apt-get autoremove looks up for packages that are marked as automatically installed, but which are no longer needed by any manually installed packages. These are often older versions of libraries (when version of library is in package name to allow different versions to coexist, e.g. libavcodec54 and libavcodec56) or packages removed from repository, but sometimes some useful application gets pulled in as dependency and then is removed. This happens especially when you first tell apt to install recommended or suggested packages, but then configure it to not pull in these packages as dependencies.

To remove package from list of packages considered for removal, mark that package as installed manually. You can do it using apt-mark:

apt-mark manual <package_name>

or aptitude (following commands are equivalent, use only one):

aptitude unmarkauto <package_name>
aptitude install <package_name>
aptitude install <package_name>&m

Finally, to get some context when these particular packages were installed, you can try searching their names in /var/log/apt/history.log files. These logs are rotated (compressed and put in separate file) monthly; to get the full archive, you can run (order will not be preserved):

cat /var/log/apt/history.log > /tmp/full-archive
zcat history.log* >> /tmp/full-archive
  • Ok, that is helpful information. Can you explain how it is possible that "fs-uae" and "fs-uae-launcher" are considered for removal? I am sure that I installed these manually using Muon Discover. – Silicomancer Sep 20 '15 at 21:59
  • You probably removed the "parent" package that required that fs-uae. So it is not needed any more. @Silicomancer – Pilot6 Sep 20 '15 at 22:11
  • 1
    @Silicomancer my guess is that you had fs-uae-arcade installed. It depends on fs-uae and recommends fs-uae-launcher, so would pull these two as dependencies in default configuration. But also, you can mark packages as automatically installed in the same way you can mark them as manually installed. Maybe you have done that incidentally during your experiments. I wouldn't count on that explanation, but there might be a bug in Muon that caused them to be considered automatically installed even when they were not. – Mirek Długosz Sep 20 '15 at 22:27

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.