2

I'm running Ubuntu 14.04 and a little new to using it. So every time I install something through either aptitude or apt-get I get this message, as seen bellow. Aptitude won't let me continue installation unless I remove these packages, however, I worked around it using apt-get. Is it safe for me to remove these packages without messing something up?

The following packages were automatically installed and are no longer required: gir1.2-totem-1.0 gir1.2-totem-plparser-1.0 libtotem0 linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic linux-image-3.19.0-25-generic linux-image-extra-3.19.0-25-generic Use 'apt-get autoremove' to remove them.

1
  • Yes, it is absolutely safe. You can remove them or just leave it. If you want more disk space, just run sudo apt-get autoremove .
    – adadion
    Nov 26, 2015 at 4:26

1 Answer 1

8

When you install a package and APT needs to install one or more additional packages that you didn't explicitly request because they are dependencies, APT keeps a record that these were "automatically installed" - ie, that they were not explicitly requested.

The only reason it remembers this, is so that it knows it can automatically remove these additional packages when all the packages that depended on them are also removed.

Using apt-get, this is done by either

apt-get remove <mainpackage>
apt-get autoremove

Or, you can tell apt-get to do the autoremove at the same time:

apt-get autoremove <mainpackage>

Note: other APT front-ends such as aptitude can also take advantage of this.

The auto-remove statement tells APT to remove any packages that were marked as automatically installed, and no longer have installed packages depending on them.

In almost all cases, this operation is safe, because they will most likely be packages you never interacted with directly; only via the other package that depended on them.

The only scenario where this may cause a problem is when a package is initially installed automatically without being explicitly requested, but later you begin to start using that package directly. When you do an autoremove after removing the original package that depended on it, you find that this new package you started using is also gone because it was originally marked as automatically installed.

This operation is pretty easy to reverse and is not usually a large problem, and it's a rare scenario. With apt-get, you can ensure an installed package is never automatically removed by explicitly requesting its installation with

apt-get install <package>

If that package is already installed, it will remain installed and merely have its "automatically installed" status removed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .