sudo apt autoremove
LanceHaverkamp
Status: Curious
Joined: 05 Jan 2011
Posts: 6
Reply Quote
sudo apt autoremove does not seem to clean-up old kernel files for Liquorix, like it does for stock kernels. Is there a process to automate this maintenance?

Thanks,
Lance
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 867
Reply Quote
It should after about 3 to 4 generations of kernel updates. I use this feature on Debian/Ubuntu to clean up old kernels myself and it's been working without issues for me. Maybe a configuration difference is excluding Liquorix package cleanups on your system?
Back to top
LanceHaverkamp
Status: Curious
Joined: 05 Jan 2011
Posts: 6
Reply Quote
I've got dozens of old versions:
Here's what I'm seeing
[img]https://ibb.co/xqcHt65[/img]

Is everyone just ignoring these, or ????
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 867
Reply Quote
I think it might be just your system. You never mentioned it so I don't even know what distribution or version you're running, and how long you've been running and customizing it. But, default installations of Debian and Ubuntu handle autoremove correctly, or at least I've never seen one disable it by default.

On a Debian system I own, I ran apt-get autoremove and it correctly found an older kernel and wants to remove it:

:: Code ::
$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-5.9.0-16.1-liquorix-amd64 linux-image-5.9.0-16.1-liquorix-amd64
0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
After this operation, 406 MB disk space will be freed.
Do you want to continue? [Y/n]


And taking a peek in /etc/apt/apt.conf.d, there's two files defining autoremove behavior: 01autoremove and 01autoremove-kernels. The 01autoremove-kernels is generated by /etc/kernel/postinst.d/apt-auto-removal. This file is maintained by the apt package:

:: Code ::
$ sudo apt-file search apt-auto-removal
apt: /etc/kernel/postinst.d/apt-auto-removal


Most likely there's something on your system that's different than what comes with standard Debian/Ubuntu installs, and it broke autoremove for kernels, and maybe everything else.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3999
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
It may matter if you are using the kernel image/headers metapackage or installing each directly. I don't beleive autoremove will remove packages installed directly, though I'm not sure, usually it removes dependencies that are no longer required, but if you have old kernels that you installed directly via apt, that's how I always do it, I never use the metapackages, then those kernels are NOT subject to autoremove in my experience, nor should they be since they are not unneeded dependencies.

however, kernel images/headers installed as a dependency of the metapackages should be subject to autoremoval once they aren't dependencies, but I don't really understand exactly how this works.

If that's the case here, this is not a bug, nor a valid issue, but highly desirable behavior. I am the only thing on my system that decides when to remove kernels, period.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours