Score:3

How to recover from purging linux-generic*?

cn flag

Using Kubuntu 20.04.3 LTS (5.4.0-91-generic), my / was getting full and, wrongly following the instructions in https://askubuntu.com/a/1325691/91300 I did:

$ sudo apt-mark auto $(apt-mark showmanual | grep linux-)
$ sudo apt autoremove --purge

which removed:

  linux-generic* linux-headers-5.4.0-45* linux-headers-5.4.0-45-generic* linux-headers-5.4.0-47* linux-headers-5.4.0-47-generic* linux-headers-5.4.0-48* linux-headers-5.4.0-48-generic*
  linux-headers-5.4.0-53* linux-headers-5.4.0-53-generic* linux-headers-5.4.0-54* linux-headers-5.4.0-54-generic* linux-headers-5.4.0-56* linux-headers-5.4.0-56-generic* linux-headers-5.4.0-58*
  linux-headers-5.4.0-58-generic* linux-headers-5.4.0-59* linux-headers-5.4.0-59-generic* linux-headers-5.4.0-65* linux-headers-5.4.0-65-generic* linux-headers-5.4.0-66*
  linux-headers-5.4.0-66-generic* linux-headers-5.4.0-67* linux-headers-5.4.0-67-generic* linux-headers-5.4.0-70* linux-headers-5.4.0-70-generic* linux-headers-5.4.0-73*
  linux-headers-5.4.0-73-generic* linux-headers-5.4.0-74* linux-headers-5.4.0-74-generic* linux-headers-5.4.0-77* linux-headers-5.4.0-77-generic* linux-headers-5.4.0-81*
  linux-headers-5.4.0-81-generic* linux-image-5.4.0-45-generic* linux-image-5.4.0-47-generic* linux-image-5.4.0-48-generic* linux-image-5.4.0-53-generic* linux-image-5.4.0-54-generic*
  linux-image-5.4.0-56-generic* linux-image-5.4.0-58-generic* linux-image-5.4.0-59-generic* linux-image-5.4.0-65-generic* linux-image-5.4.0-66-generic* linux-image-5.4.0-67-generic*
  linux-image-5.4.0-70-generic* linux-image-5.4.0-73-generic* linux-image-5.4.0-74-generic* linux-image-5.4.0-77-generic* linux-image-5.4.0-81-generic* linux-modules-5.4.0-45-generic*
  linux-modules-5.4.0-47-generic* linux-modules-5.4.0-48-generic* linux-modules-5.4.0-53-generic* linux-modules-5.4.0-54-generic* linux-modules-5.4.0-56-generic* linux-modules-5.4.0-58-generic*
  linux-modules-5.4.0-59-generic* linux-modules-5.4.0-65-generic* linux-modules-5.4.0-66-generic* linux-modules-5.4.0-67-generic* linux-modules-5.4.0-70-generic* linux-modules-5.4.0-73-generic*
  linux-modules-5.4.0-74-generic* linux-modules-5.4.0-77-generic* linux-modules-5.4.0-81-generic* linux-modules-extra-5.4.0-45-generic* linux-modules-extra-5.4.0-47-generic*
  linux-modules-extra-5.4.0-48-generic* linux-modules-extra-5.4.0-53-generic* linux-modules-extra-5.4.0-54-generic* linux-modules-extra-5.4.0-56-generic* linux-modules-extra-5.4.0-58-generic*
  linux-modules-extra-5.4.0-59-generic* linux-modules-extra-5.4.0-65-generic* linux-modules-extra-5.4.0-66-generic* linux-modules-extra-5.4.0-67-generic* linux-modules-extra-5.4.0-70-generic*
  linux-modules-extra-5.4.0-73-generic* linux-modules-extra-5.4.0-74-generic* linux-modules-extra-5.4.0-77-generic* linux-modules-extra-5.4.0-81-generic* linux-tools-5.4.0-45*
  linux-tools-5.4.0-45-generic* linux-tools-5.4.0-47* linux-tools-5.4.0-47-generic* linux-tools-5.4.0-48* linux-tools-5.4.0-48-generic* linux-tools-5.4.0-53* linux-tools-5.4.0-53-generic*
  linux-tools-5.4.0-54* linux-tools-5.4.0-54-generic* linux-tools-5.4.0-56* linux-tools-5.4.0-56-generic* linux-tools-5.4.0-58* linux-tools-5.4.0-58-generic* linux-tools-5.4.0-59*
  linux-tools-5.4.0-59-generic* linux-tools-5.4.0-65* linux-tools-5.4.0-65-generic* linux-tools-5.4.0-66* linux-tools-5.4.0-66-generic* linux-tools-5.4.0-67* linux-tools-5.4.0-67-generic*
  linux-tools-5.4.0-70* linux-tools-5.4.0-70-generic* linux-tools-5.4.0-73* linux-tools-5.4.0-73-generic* linux-tools-5.4.0-74* linux-tools-5.4.0-74-generic* linux-tools-5.4.0-77*
  linux-tools-5.4.0-77-generic* linux-tools-5.4.0-81* linux-tools-5.4.0-81-generic*

All of which seems fine1 (latest two kernels are not included) except for the first entry, that escaped me: linux-generic*.

My system is still running right now, but I'm afraid it's now broken and won't boot next time. Am I mistaken and, if not, how to best recover?

1 Well, now I've noticed something else that's worrying: nvidia 390.144 (5.4.0-81-generic) [...] Status: Before uninstall, this module version was ACTIVE on this kernel.

cn flag
@guiverc Sorry for forgetting - it's Kubuntu 20.04.3 LTS (added to the question). As for nvidia, I don't recall for sure (been using this machine and upgrading to new releases for a long time), but probably installed them manually at some point.
user535733 avatar
cn flag
Try `sudo apt install linux-image-generic linux-headers-generic`. If your system is not haywired in some other unexpected way, that should reinstall one kernel (for booting), the corresponding headers (for dkms), and restore automatic upgrades when new kernels become available. If the command fails, paste the complete output in your question above.
cn flag
@user535733 Those packages are already installed (checked now). Do you mean `sudo apt install linux-generic`?
cn flag
Now I see that `linux-generic` is listed as `Priority: optional`. Are my fears unfounded after all?
user535733 avatar
cn flag
If those two packages are already installed, then run `ls -l /boot`. You should have a kernel, and initrd.img matching the kernel, and a few other matching files. If so, then have a LiveUSB on hand as a recovery media, and do your test reboot. Reinstalling `linux-generic` is optional -- were it my system, I would.
cn flag
@user535733 Thanks, I did as you suggested all seems fine.
Score:1
cn flag

So, following the suggestion by user535733 -- after confirming that linux-image-generic and linux-headers-generic were still installed and that all files in /boot seemed in place -- I simply reinstalled linux-generic and rebooted the system.

It's been a few weeks now and so far all seems to be just as before the purge/reinstall.

As the package is listed as Priority: optional, it might very well be that my fears were unfounded - all the better - though I can't tell what the consequences would be if I had rebooted the system without reinstalling linux-generic before.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.