Hello. I don't remember since when, but when I install a new kernel, konsole output says that I may remove an old one with autoremove. Since it may be wise to keep at least one old, stable kernel, how can I set it to not be removed and therefore not receive such messages from konsole?
Announcement
Collapse
No announcement yet.
Keeping Old Kernels
Collapse
This topic is closed.
X
X
-
If you look at /etc/kernel/postinst.d/apt-auto-removal:
# Author: Steve Langasek <steve.langasek@canonical.com>
#
# Mark as not-for-autoremoval those kernel packages that are:
# - the currently booted version
# - the kernel version we've been called for
# - the latest kernel version (determined using rules copied from the grub
# package for deciding which kernel to boot)
# - the second-latest kernel version, if the booted kernel version is
# already the latest and this script is called for that same version,
# to ensure a fallback remains available in the event the newly-installed
# kernel at this ABI fails to boot
# In the common case, this results in exactly two kernels saved, but it can
# result in three kernels being saved. It's better to err on the side of
# saving too many kernels than saving too few.
#
# We generate this list and save it to /etc/apt/apt.conf.d instead of marking
# packages in the database because this runs from a postinst script, and apt
# will overwrite the db when it exits.
- Top
- Bottom
-
Originally posted by geoaraujo View PostHello kubicle. I've installed Kernel 3.13.1-pf for testing. And now konsole output says I may remove 3.13.0-23-generic. But isn't it the last stable kernel for Kubuntu 14.04, since the one currently being used is 3.13.0-24-generic?
If you plan to use more than one "test" kernels, you can override autoremoval of specific kernel versions to keep at least one "stable and bootable" kernel from the main repos installed by creating a file /etc/apt/apt.conf.d/02mystablekernel with the contents:
APT::NeverAutoRemove
{
"<regex to match excluded packages>";
};
/etc/apt/apt.conf.d/01autoremove-kernels (don't edit that file because it's automatically overwritten by the postinst script)
- Top
- Bottom
Comment
-
I see. So, should I create a new file replacing every line displayed by that file with the ones I want to keep? I mean, in this case, creating a file that includes the 3.13.0-23-generic besides 3.13.1-pf and 3.13.0-24-generic or just a file that contains regex for 3.13.0-23-generic?
- Top
- Bottom
Comment
-
Originally posted by geoaraujo View PostI see. So, should I create a new file replacing every line displayed by that file with the ones I want to keep? I mean, in this case, creating a file that includes the 3.13.0-23-generic besides 3.13.1-pf and 3.13.0-24-generic or just a file that contains regex for 3.13.0-23-generic?
I'd put the latest 3.13.0-24-generic in there, unless there is a specific reason to keep 3.13.0-23-generic instead, this will keep the 3.13.0-24-generic main repo kernel from being autoremoved no matter how many "test" kernels you install (and/or autoremove)...so you'll have one backup stable kernel always installed...you can then periodically change your back up kernel by editing the file if you wish to switch your backup to a newer "stable" kernel.
- Top
- Bottom
Comment
Comment