[GTALUG] Ubuntu (or debian): apt-get auto-remove?

Blaise Alleyne email+libre at blaise.ca
Thu Aug 13 15:17:26 UTC 2015


On 13/08/15 11:06 AM, Lennart Sorensen wrote:
> On Thu, Aug 13, 2015 at 10:57:09AM -0400, D. Hugh Redelmeier wrote:
>> After my update from Ubuntu 12.04 to 14.04, apt-get tells me that there 
>> are a lot of packages that apt-get auto-remove could remove.
>>
>> Is that safe?  What is the underlying idea?
> 
> Yes.  The idea is that libraries and such that were dependancies of foo
> version x and no longer needed by foo version y, so nothing depends
> on them anymore, and since you did not explicitly ask for them to be
> installed (they were installed automatically to solve dependancies)
> they can now be removed.
> 
>> I think that it removes things that were added due to dependencies where 
>> those dependencies no longer exist.  In the back of my mind, I worry that 
>> sometimes dependencies might be things that I wanted independently of why 
>> they were installed, but I'm not sure of that.
>>
>> Do people fine apt-get auto-remove works great or do you find that it 
>> throws a few babies out with the bathwater?
> 
> It has never failed me.
> 

Agreed.

The only way in which it's (rarely) a pain is if you accidentally uninstalled a
package that then uninstalls another package, messing with your intended
setup... e.g. common example is (was?) trying to remove Evolution, which is a
depenedency of some GNOME stuff. So if you uninstall Evolution, then it
uninstalls some GNOME metapackages, and then a bunch of other GNOME packages
which you still might want are suddenly "no longer required" because you don't
have the meta package.

But the problem there is not with autoremove, it's with the fact that GNOME
requires Evolution. autoremove's behaviour is useful there; the Evolution
dependency is the PITA.


Why don't you just see what packages it's going to uninstall?

Usually it lists them, but you can also run something like:
`sudo apt-get autoremove --dry-run`

I've almost never had a problem (I can't remember a specific case). But if you
do, you can then just mark the packages you want to keep as manually install (by
running `sudo apt-get install packageiactuallywanttokeep`), and then go back to
autoremove.


Also, worst-case scenario, you can just reinstall a package.



More information about the talk mailing list