On 25-07-17, Cindy-Sue Causey wrote:
> On 7/25/17, Dejan Jocic <jode...@gmail.com> wrote:
> > On 25-07-17, Greg Wooledge wrote:
> >> On Tue, Jul 25, 2017 at 09:41:24AM +0200, Dejan Jocic wrote:
> >> > When you upgrade to Jessie, it will install new kernel automatically.
> >> > However, it should not remove your Wheezy kernel, because upgrading
> >> > kernels always leaves one old one there, in case that you can not boot
> >> > into your new kernel for some reason. You can then mark that kernel via
> >> > grub options as one you would like to boot in. You can do it during
> >> > boot
> >> > in grub, or by setting it as default in /etc/default/grub.
> >>
> >> All true.
> >>
> >> > You will also
> >> > have to use apt-mark to put that kernel on hold, to prevent removing it
> >> > on future updates, or to do some apt pinning.
> >>
> >> False.  The kernel will simply sit there forever, unless you take some
> >> explicit action to remove it.  No holds or pinning or other wrestling
> >> required.
> >>
> >
> > That is not true, if you use autoremove. Only 2 last kernels will be
> > kept. This is upgrade from Jessie here. I have 4.9.0.2 and 4.9.0.3
> > kernels. Jessie kernel is long gone with autoremove.
> 
> 
> Well, that's a little... scary. *frown*
> 
> Except that... I just deleted the rest of what I first wrote because
> it hit me. Autoremove is what apt-get tells me to use to remove
> packages..... that are no longer needed.... that are no longer
> "dependencies". What it actually tells *me* is something like "apt
> autoremove" (not "apt-get autoremove").
> 
> Aaaahhhh... So in autoremove's mind... It might touch on that previous
> kernel and say... hm, nothing's using it now, nothing needs it to
> function properly, so trash it........
> 
> Or something like that.... there...... :)
> 
> Cindy :)
> -- 
> Cindy-Sue Causey
> Talking Rock, Pickens County, Georgia, USA
> 
> * runs with duct tape *
> 

What it touch is /etc/kernel/postinst.d/apt-auto-removal that generates
/etc/apt/apt.conf.d/01autoremove-kernels file. Those decide what kernels
to keep. And, in case of /etc/kernel/postinst.d/apt-auto-removal it is
clearly stated:

# 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 (as determined by debian version number) -
# the second-latest kernel version
#
# In the common case this results in two kernels saved (booted into the
# second-latest kernel, we install the latest kernel in an upgrade), but
# can save up to four. Kernel refers here to a distinct release, which
# can potentially be installed in multiple flavours counting as one
# kernel.



Reply via email to