Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #204059 > unrolled thread

How to ensure that old kernel does not get removed

Started by"hdv@gmail" <hdv.jadev@gmail.com>
First post2019-01-05 03:50 +0100
Last post2019-01-07 21:30 +0100
Articles 10 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  How to ensure that old kernel does not get removed "hdv@gmail" <hdv.jadev@gmail.com> - 2019-01-05 03:50 +0100
    Re: How to ensure that old kernel does not get removed Reco <recoverym4n@enotuniq.net> - 2019-01-05 09:00 +0100
      Re: How to ensure that old kernel does not get removed "hdv@gmail" <hdv.jadev@gmail.com> - 2019-01-05 11:20 +0100
        Re: How to ensure that old kernel does not get removed Reco <recoverym4n@enotuniq.net> - 2019-01-05 11:20 +0100
          Re: How to ensure that old kernel does not get removed "hdv@gmail" <hdv.jadev@gmail.com> - 2019-01-05 11:40 +0100
    Re: How to ensure that old kernel does not get removed songbird <songbird@anthive.com> - 2019-01-05 15:50 +0100
      Re: How to ensure that old kernel does not get removed "hdv@gmail" <hdv.jadev@gmail.com> - 2019-01-05 17:00 +0100
      Re: How to ensure that old kernel does not get removed Greg Wooledge <wooledg@eeg.ccf.org> - 2019-01-07 14:40 +0100
        Re: How to ensure that old kernel does not get removed songbird <songbird@anthive.com> - 2019-01-07 15:40 +0100
          Re: How to ensure that old kernel does not get removed David Wright <deblis@lionunicorn.co.uk> - 2019-01-07 21:30 +0100

#204059 — How to ensure that old kernel does not get removed

From"hdv@gmail" <hdv.jadev@gmail.com>
Date2019-01-05 03:50 +0100
SubjectHow to ensure that old kernel does not get removed
Message-ID<xcKca-8aP-15@gated-at.bofh.it>
Hi list,

After a recent upgrade I noticed that my system could not reboot into the new
4.19 kernel. So I rebooted into the kernel before that (4.18.0-3), which did not
work either. Booting into the version before that (4.18.-02) did work just fine.

It seems I hadn't rebooted after the previous upgrade, causing me to have 2
versions that do not work for my system without noticing. (I do not regularly
reboot.)

After rebooting the failing kernels show a lot of errors about not being able to
find processor IDs and after that they stop with the message that they can't
find the encrypted device containing / (actually everything apart from /boot).
Sorry, I haven't captured the exact error messages, so I can't show the full
text of them.

So how do I make sure that 4.18.0-2 does not get removed from the boot menu
after the next kernel upgrade? I'd like to keep it until I have verified that an
upgrade does work. However, as far as I can tell only the last 3 kernels are
kept. Thus now I run the risk of having the only working version removed before
I am sure that a new version will work.

A perusal of the Grub2 documentation did not give me a pointer on how to do
this. Nor did I find a setting for this in /etc/default/grub or /etc/grub.d/. As
a matter of fact I am not even sure grub is the proper place for this. Grub only
builds a boot menu, but it does not remove kernels (as far as I am aware).

Any pointers in the right direction will be appreciated!

Grx HdV

[toc] | [next] | [standalone]


#204073

FromReco <recoverym4n@enotuniq.net>
Date2019-01-05 09:00 +0100
Message-ID<xcP29-2FK-1@gated-at.bofh.it>
In reply to#204059
	Hi.

On Sat, Jan 05, 2019 at 03:41:05AM +0100, hdv@gmail wrote:
> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
> after the next kernel upgrade?

Do not uninstall this version of kernel, simple as that.
Invoke this to be sure:

apt-mark hold linux-image-4.18.0-2-amd64

Reco

[toc] | [prev] | [next] | [standalone]


#204080

From"hdv@gmail" <hdv.jadev@gmail.com>
Date2019-01-05 11:20 +0100
Message-ID<xcRdD-49k-1@gated-at.bofh.it>
In reply to#204073
On 05/01/2019 08.52, Reco wrote:
> 	Hi.
> 
> On Sat, Jan 05, 2019 at 03:41:05AM +0100, hdv@gmail wrote:
>> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
>> after the next kernel upgrade?
> 
> Do not uninstall this version of kernel, simple as that.
> Invoke this to be sure:
> 
> apt-mark hold linux-image-4.18.0-2-amd64

Aha, apt-mark. I didn't know about that one. I am gonna read up on it. Thanks
for helping!

I reccon that not removing this kernel will also make sure it stays in the boot
menu of grub?

Grx HdV

[toc] | [prev] | [next] | [standalone]


#204081

FromReco <recoverym4n@enotuniq.net>
Date2019-01-05 11:20 +0100
Message-ID<xcRdE-49k-5@gated-at.bofh.it>
In reply to#204080
On Sat, Jan 05, 2019 at 11:16:23AM +0100, hdv@gmail wrote:
> On 05/01/2019 08.52, Reco wrote:
> > 	Hi.
> > 
> > On Sat, Jan 05, 2019 at 03:41:05AM +0100, hdv@gmail wrote:
> >> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
> >> after the next kernel upgrade?
> > 
> > Do not uninstall this version of kernel, simple as that.
> > Invoke this to be sure:
> > 
> > apt-mark hold linux-image-4.18.0-2-amd64
> 
> Aha, apt-mark. I didn't know about that one. I am gonna read up on it. Thanks
> for helping!
> 
> I reccon that not removing this kernel will also make sure it stays in the boot
> menu of grub?

/etc/grub.d/10_linux should process all kernels that are found in /boot.
So yes, it should.

Reco

[toc] | [prev] | [next] | [standalone]


#204083

From"hdv@gmail" <hdv.jadev@gmail.com>
Date2019-01-05 11:40 +0100
Message-ID<xcRx0-4g0-21@gated-at.bofh.it>
In reply to#204081
On 05/01/2019 11.19, Reco wrote:
> On Sat, Jan 05, 2019 at 11:16:23AM +0100, hdv@gmail wrote:
>> On 05/01/2019 08.52, Reco wrote:
>>> 	Hi.
>>>
>>> On Sat, Jan 05, 2019 at 03:41:05AM +0100, hdv@gmail wrote:
>>>> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
>>>> after the next kernel upgrade?
>>>
>>> Do not uninstall this version of kernel, simple as that.
>>> Invoke this to be sure:
>>>
>>> apt-mark hold linux-image-4.18.0-2-amd64
>>
>> Aha, apt-mark. I didn't know about that one. I am gonna read up on it. Thanks
>> for helping!
>>
>> I reccon that not removing this kernel will also make sure it stays in the boot
>> menu of grub?
> 
> /etc/grub.d/10_linux should process all kernels that are found in /boot.
> So yes, it should.

Hi Reco,

apt-mark was exactly what I needed. It seems I haven't kept my Debian fuu up to
date, as I had never seen and thus used apt-mark. Shame on me. I am gonna have
to read up on the apt family of commands to keep with the program!

Thanks again!

Grx HdV

[toc] | [prev] | [next] | [standalone]


#204091

Fromsongbird <songbird@anthive.com>
Date2019-01-05 15:50 +0100
Message-ID<xcVqW-6Bw-19@gated-at.bofh.it>
In reply to#204059
hdv@gmail wrote:
...
> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
> after the next kernel upgrade? I'd like to keep it until I have verified that an
> upgrade does work. However, as far as I can tell only the last 3 kernels are
> kept. Thus now I run the risk of having the only working version removed before
> I am sure that a new version will work.

  another way to do it for all kernels is to add the
options to apt itself (in /etc/apt/apt.conf or ...)

  i set options to make sure apt doesn't get rid of
my saved cache files without me explicitly requesting
it and there is another option for setting which files
are never marked for autoremoval.


APT::Clean-Installed "false";
APT::NeverAutoRemove  { "linux-image.*";  };  // packages that should never
                                            // considered for autoRemove

  i no longer see grub menus very often (using
uefi boot menu and refind).


  songbird

[toc] | [prev] | [next] | [standalone]


#204094

From"hdv@gmail" <hdv.jadev@gmail.com>
Date2019-01-05 17:00 +0100
Message-ID<xcWwG-7gr-7@gated-at.bofh.it>
In reply to#204091
On 05/01/2019 14.45, songbird wrote:
> hdv@gmail wrote:
> ...
>> So how do I make sure that 4.18.0-2 does not get removed from the boot menu
>> after the next kernel upgrade? I'd like to keep it until I have verified that an
>> upgrade does work. However, as far as I can tell only the last 3 kernels are
>> kept. Thus now I run the risk of having the only working version removed before
>> I am sure that a new version will work.
> 
>   another way to do it for all kernels is to add the
> options to apt itself (in /etc/apt/apt.conf or ...)
> 
>   i set options to make sure apt doesn't get rid of
> my saved cache files without me explicitly requesting
> it and there is another option for setting which files
> are never marked for autoremoval.
> 
> 
> APT::Clean-Installed "false";
> APT::NeverAutoRemove  { "linux-image.*";  };  // packages that should never
>                                             // considered for autoRemove
> 
>   i no longer see grub menus very often (using
> uefi boot menu and refind).

Thanks for this information! Very useful. I will add it to the list of things I
have to (re)educate myself in.

Grx HdV

[toc] | [prev] | [next] | [standalone]


#204168

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2019-01-07 14:40 +0100
Message-ID<xdDih-8o6-9@gated-at.bofh.it>
In reply to#204091
On Sat, Jan 05, 2019 at 08:45:37AM -0500, songbird wrote:
> APT::Clean-Installed "false";
> APT::NeverAutoRemove  { "linux-image.*";  };  // packages that should never
>                                             // considered for autoRemove

Yeah, personally I'm all about that Never Auto Remove.

wooledg:~$ cat /etc/apt/apt.conf.d/99local 
APT::NeverAutoRemove ".";

This completely disables that "feature" and leaves my system alone, just
how I want it.

[toc] | [prev] | [next] | [standalone]


#204173

Fromsongbird <songbird@anthive.com>
Date2019-01-07 15:40 +0100
Message-ID<xdEem-xK-3@gated-at.bofh.it>
In reply to#204168
Greg Wooledge wrote:
> On Sat, Jan 05, 2019 at 08:45:37AM -0500, songbird wrote:
>> APT::Clean-Installed "false";
>> APT::NeverAutoRemove  { "linux-image.*";  };  // packages that should never
>>                                             // considered for autoRemove
>
> Yeah, personally I'm all about that Never Auto Remove.
>
> wooledg:~$ cat /etc/apt/apt.conf.d/99local 
> APT::NeverAutoRemove ".";
>
> This completely disables that "feature" and leaves my system alone, just
> how I want it.

  i've never gone to that extreme, i just want
the previous kernel-images to not go away until
i explicitly say to do so.  this means that i do
have to go clean them out manually.


  as an aside unfortunately for a default install 
the initial packages installed and used in the apt 
cache are cleared unless you figure out how to 
prevent that (via preseeding or some other method).

  when you are trying to audit a system to know
exactly what has been installed (and then replaced
by what) it is rather annoying.  there are logs
kept during install so the information is available
but i also liked before that the cache was left
intact until i explicitly requested it be cleared
or adjusted in any way.


  songbird

[toc] | [prev] | [next] | [standalone]


#204197

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-01-07 21:30 +0100
Message-ID<xdJH4-3Z9-7@gated-at.bofh.it>
In reply to#204173
On Mon 07 Jan 2019 at 09:18:40 (-0500), songbird wrote:
> Greg Wooledge wrote:
> > On Sat, Jan 05, 2019 at 08:45:37AM -0500, songbird wrote:
> >> APT::Clean-Installed "false";
> >> APT::NeverAutoRemove  { "linux-image.*";  };  // packages that should never
> >>                                             // considered for autoRemove
> >
> > Yeah, personally I'm all about that Never Auto Remove.
> >
> > wooledg:~$ cat /etc/apt/apt.conf.d/99local 
> > APT::NeverAutoRemove ".";
> >
> > This completely disables that "feature" and leaves my system alone, just
> > how I want it.
> 
>   i've never gone to that extreme, i just want
> the previous kernel-images to not go away until
> i explicitly say to do so.  this means that i do
> have to go clean them out manually.
> 
> 
>   as an aside unfortunately for a default install 
> the initial packages installed and used in the apt 
> cache are cleared unless you figure out how to 
> prevent that (via preseeding or some other method).
> 
>   when you are trying to audit a system to know
> exactly what has been installed (and then replaced
> by what) it is rather annoying.  there are logs
> kept during install so the information is available
> but i also liked before that the cache was left
> intact until i explicitly requested it be cleared
> or adjusted in any way.

The very earliest package .deb files might never be downloaded to
/var/cache/apt/archives because they're already in
firmware-9.5.0-amd64-netinst.iso/iso9660://pool/ for example
but I haven't checked this out recently because of the
caching I do.

For example, the first package set up according to installer/syslog,
base-passwd (3.5.43) is here:
pool/main/b/base-passwd/base-passwd_3.5.43_amd64.deb 57656 Jan 16 2017

For those that are downloaded later in the installation, I rely on
apt-cacher-ng through which the installation takes place.

If you're not running a cacher, then the simplest way to grab these
packages is by running a shell on VC2 and

# mkdir /target/home/<first user>/somewhere
# cp -ip /target/var/cache/apt/archives/*deb /target/home/<first user>/somewhere/

Do this after configuring grub and before "Finish the installation"

Cheers,
David.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web