7

I have ubuntu 16.04;

Installed kernel linux-image-4.13.0-31 update, but I didn't like it, so I decided I want to keep using 4.13.0-26 for now. How can I prevent the update from affecting the kernel version?

nosklo
  • 383
  • 2
    No need, simply use GRUB to boot into -26. The script that marks older kernels as eligible for autoremoval won't mark the currently-running kernel (for obvious reasons). – user535733 Jan 25 '18 at 01:01
  • 1
    If you do stop at -26 note kernels will keep getting installed. FYI I have 8 GB in kernels I've manually installed. Each kernel is about 400 MB: https://askubuntu.com/questions/892076/how-to-selectively-purge-old-kernels-all-at-once/892077#892077 – WinEunuuchs2Unix Jan 25 '18 at 01:08

1 Answers1

6

To prevent the kernel from getting purged by sudo apt autoremove, pin the kernel using:

sudo apt-mark hold linux-image-4.13.0-26-generic linux-headers-4.13.0-26-generic

If you boot with version -26 and run autoremove without pinning the kernel first, it still won't be removed because you booted with it. If you boot with the newest kernel version and run autoremove then -26 will be purged if it's not the most recent or the next most recent version installed.