5

Since I've found similar threads (1, 2) but are not helpful to my issues, I'm opening up a new question.

Occassionally when I run apt-get, I get:

The following packages were automatically installed and are no longer required:
:
  (list of packages)

This occurs often with the packages that I heavily use. However, because they are not used by the OS, the error message itself makes sense if required means OS is the one used to require those packages.

How can I stop this to happen / let OS know that I need these packages?

Since there ARE cases when this notification is actually useful (eg. packages that OS used to require are no longer in need AND I do not used them too), I prefer solution/workaround that allows case-by-case setting.

apt 0.8.16~exp12ubuntu10.11

5

In case you are using packages which are marked as "automatically installed", you should tell the package management that you want them explicitly rather than a dependency:

sudo apt-mark unmarkauto packagename

The purpose of this auto/manual mark on a package installation is to keep the system clean if you install package-x which installs several dependencies (say package-y, package-z). APT will then know that package-y and package-z are not needed anymore if you remove package-x some day later - use sudo apt-get autoremove to perform the removal.

Don't mark dependencies as manually installed, as that would defeat the purpose of the above.

In order to find out why certain packages are installed automatically, you want to use

aptitude why packagename
| improve this answer | |
  • Thanks for a clear answer. One note; unmarkauto option in apt-mark may be deprecated now (I got stopped with a message) - we may use instead hold. – IsaacS Jul 22 '13 at 15:49
  • Try also : apt-mark showauto | xargs apt-get install – David Goodwin May 26 '16 at 7:48

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