4

I am doing experiments with few Linux kernels, also I want to keep all the kernels on my system; I don't want then to be removed automatically. how do I achieve that?

(NOTE: I have mounted /boot on separate 4GB partition so space is not an issue)

  • You can keep them by not removing them, Ubuntu will not remove old kernels automatically. – Ron Sep 2 '15 at 9:32
  • @Ron as far as I know if you install new kernel, old kernels are removed by apt automatically – Edward Torvalds Sep 2 '15 at 9:36
  • No it will not. Just installed 4.1.1 and my old one is still there. – Ron Sep 2 '15 at 9:46
  • @Ron is the all the three old kernels still available in grub? when i receive kernel update one oldest kernel is removed – Edward Torvalds Sep 2 '15 at 9:57
  • I had only 1 before, so now it is 2 – Ron Sep 2 '15 at 14:29
1

/etc/kernel/postinst.d/apt-auto-removal generates /etc/apt/apt.conf.d/01autoremove-kernels.

So you can create new file APT configuration file same way.

sudo nano /etc/apt/apt.conf.d/01autoremove-kernels-stop

contains:

APT::NeverAutoRemove
{
   "^linux-image-*-generic$";
   "^linux-headers-*-generic$";
   "^linux-image-extra-*-generic$";
   "^linux-signed-image-*-generic$";
   "^.*-kernel-*-generic$";
   "^linux-tools-*-generic$";
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.