Add `apt autoremove`
-
Currently we use the ubuntu system cron to take care of that. But I agree it was so far far from optimal, especially around kernel updates, which seem to pollute the
/boot
partition.
I think we have to build our own mechanism there, essentially our own cron which runs the appropriate apt commands.Does anyone here have more experience with this?
-
@nebulon I think this : sudo apt autoremove --purge
should be enough to clean up old kernels safely
edit : The above commands only work on newer systems as all old Linux kernels and headers automatically flagged as no more needed, and thus can be purged.this link has all the different ways to remove old kernels safely : https://www.cyberciti.biz/faq/ubuntu-18-04-remove-all-unused-old-kernels/
-
@necrevistonnezr said in Add `apt autoremove`:
Cloudron is on 16.04
Cloudron runs currently on both 16.04 and 18.04, and soon on 20.04
-
@mehdi Right! I even asked for 18.04 back in the day ! Alzheimers....
-
I assume this feature is to
autoremove
stuff is only for removing old kernels? I have to say I have not seen the issue of boot filling up in Ubuntu 18. Has anyone hit this in bionic?Also, ubuntu security updates does not add new packages (only updates existing ones). So, AFAIK, this feature is only for removing kernels and nothing else. I am happy to add some button (instead of an automated cron).
-
@girish
autoremove
removes packages which were installed automatically (as dependencies of other packages you installed), and which are not needed anymore.For example, if you install package
A
manually at version 1.0, which depends on packageB
, then at a later point in timeA
gets updated to 2.0 which does not depend onB
anymore. Well in this case,B
stays installed, but is not necessary, andautoremove
removes it. -
@mehdi Right, but I meant in the context of Cloudron why does one ever need to 'autoremove'? Since Cloudron itself doesn't install packages once installed. Is this for the use case of people installing some packages outside of Cloudron (if so, is it then wise to autoremove stuff?)?
-
@girish In cloudron's case, yeah I don't see anything other than kernels off the top of my head where this could apply, but it's still possible for dependencies of other packages.
In any case, I have personally never seen a case where
autoremove
broke stuff. -
@mehdi hmmm, I went back and checked and indeed the install script does not call autoremove in the end, maybe it should.
This feature request started with "As Cloudron does automatic security and system updates", so I just want to point out that neither of those require auto-remove since additional packages are not installed and the security updates are very conservative and not dramatic (like removing deps etc). So, except for this kernel stuff, we don't need autoremove, I think. I don't completely understand why ubuntu itself doesn't have a mechanism for this. Happy to be corrected here though
-
Wow this really exploded while I slept.
@girish That is not a correct conclusion.
@mehdi is correct above.Even with Cloudron not installing anything new, the system will over time end up with orphaned dependencies that can be removed. This includes old kernels.
It will not harm the system, only keep it less cluttered and do the
right thing
(tm).Please do the needful.
-
@mehdi Why give the admin yet another button when it can be eliminated altogether? I'd rather do it on CLI then.
Point is, I don't want to see
autoremove
whenever I run apt or have to deal with kernels filling up for poorly planned partitions or side-effects of OS vendor releasing lots of kernels and not cleaning up. -
@robi said in Add `apt autoremove`:
Point is, I don't want to see
autoremove
whenever I run apt or have to deal with kernels filling up for poorly planned partitions or side-effects of OS vendor releasing lots of kernels and not cleaning up.If
autoremove
gets integrated in the Cloudronapt update
routine, you wouldn't "see" it?! -
@necrevistonnezr No, as it would be run regularly in the background.
Hence when I run
apt install blah
manually, it has a low chance of finding it needs to remove something viaautoremove
.