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

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.