Adding a kernel removal script to linux-base or elsewhere
Jarno Suni
j_suni at yahoo.co.uk
Tue Sep 27 19:32:19 UTC 2016
Here is some update. My script does not use linux-version anymore. But I named the script linux-purge. It can remove kernels even in some problem cases where e.g. there are dependency problems due to an unsuccessful kernel update (e.g. due to full /boot partition). It provides optional UI for interactive checklist based kernel removal. It does not support kfreebsd-image and gnumach-image kernels, but only Linux kernels and it is designed to work in any flavor of Ubuntu.
Here is a demo that shows it in action:
https://youtu.be/TpsZoAnOVTU
I have not published the script yet, but maybe later, if there is enough interest.
--
Jarno Suni - http://iki.fi/8/
> On Tuesday, May 24, 2016 2:29 PM, Jarno Suni <j_suni at yahoo.co.uk> wrote:
> > Now that linux-base is part of .?ubuntu 16.04, I think it would be good to add a
> linux-kernel removal tool to linux-base. On the other hand, I think such a
> script is especially useful for some older releases, since e.g. Trusty tends to
> mark kernel updates as being manually installed packages and as such
> 'apt-get autoremove --purge' can not purge them. (
> https://bugs.launchpad.net/ubuntu/vivid/+source/aptdaemon/+bug/1439769
> https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1492709
> https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1175637)
> If automatic removal of unneeded kernels is not enabled, /boot fills up, and
> blocks kernel updates:
> https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1054927
>
> There is purge-old-kernels currently at byobu repository, but maybe it is too
> simple, and has some bugs:
> https://bugs.launchpad.net/byobu/+bug/1569228
> https://bugs.launchpad.net/bikeshed/+bug/1532153
> I have rewritten it to fix those at
>
> https://github.com/dustinkirkland/bikeshed/pull/1
> when purge-old-kernels was located at bikeshed, and as I have written in the
> (last) comment: "I have written an enhanced script for similar purpose
> again, but maybe it is not good to call it purge-old-kernels, since it can be
> used to purge newer kernels, too (but keeping the kernels that installed kernel
> meta packages depend on and given number of older ones). It currently uses
> linux-version from linux-base package to sort kernel releases as needed. I am
> looking for a suitable place to publish the bash script."
>
> Finding meta kernel packages is problematic. I have used regular expression
> matching the package names:
> http://askubuntu.com/q/775830/21005It seems to work in Ubuntu, but not in Debian
> as such, I think. Also getting versioned kernels (and packages related to kernel
> of specific release) may be problematic in general:
> https://lists.debian.org/deity/2016/05/msg00115.html
>
> So how about adding some ubuntu-purge, linux-purge or kernel-purge in
> linux-base? Should it support
> kfreebsd-image and gnumach-image that are listed by "apt-config dump"?
> --
> Jarno Suni - http://iki.fi/8/
>
More information about the Ubuntu-devel-discuss
mailing list