Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

GRUB PROBLEM Errors During Routine Updates in Sparky Terminal... now stuck in GRUB

Started by SparkyBookworm, March 05, 2023, 08:53:42 PM

Previous topic - Next topic

SparkyBookworm

This all started while attempting to fix VirtualBox failing to load my ISO's.

I've had problems in the past with VirtualBox while on Windows 10 so I am more inclined to believe that VirtualBox being updated and my own user incompetence are the problems, and NOT Sparky itself.

Yesterday while trying to fix the VirtualBox issue, I attempted to remove package virtualbox-7.0 (it wouldn't remove itself yesterday, but today it is no longer listed as installed?) and failed in my attempts to search troubleshoot / fix the Virtualbox installation, I can no longer access the VM iso I had made, when trying to start up the ISO, VirtualBox shows the error:

"error_E: linux-image-4.9.337-sparky-lts49-amd64: installed linux-image-4.9.337-sparky-lts49-amd64 package post-installation script subprocess returned error exit status 1"

More important HOWEVER, now even the routine SparkyLinux Updates are churning out similar Kernel related error complaints, as shown below, in the SparkyTerminal during a routine update appears:

"Error! Your kernel headers for kernel 4.9.337-sparky-lts49amd64 cannot be found at /lib/modules/4.9.337-sparky-lts49-amd64 or... etc etc"

How I am supposed to fix this problem?

SparkyBookworm

As Virtualbox was somehow magically uninstalled... so I tried once again to reinstall the package "virtualbox-7.0". It failed during installation of the package with the initial error message:

E: linux-image-4.9.337-sparky-lts49-amd64: installed linux-image-4.9.337-sparky-lts49-amd64 package post-installation script subprocess returned error exit status 1


And in the terminal during the attempted package installation, the following messages:

debconf: unable to initialize frontend: Gnome
debconf: (Can't locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151, <> line 1.)
debconf: falling back to frontend: Dialog
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Preconfiguring packages ...
(Reading database ... 380257 files and directories currently installed.)
Preparing to unpack .../virtualbox-7.0_7.0.6-155176~Debian~bullseye_amd64.deb ...
debconf: unable to initialize frontend: Gnome
debconf: (Can't locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151.)
debconf: falling back to frontend: Dialog
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Unpacking virtualbox-7.0 (7.0.6-155176~Debian~bullseye) ...
Setting up linux-image-4.9.337-sparky-lts49-amd64 (4.9.337-1) ...
dkms: running auto installation service for kernel 4.9.337-sparky-lts49-amd64:Sign command: /lib/modules/4.9.337-sparky-lts49-amd64/build/scripts/sign-file
Binary /lib/modules/4.9.337-sparky-lts49-amd64/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 4.9.337-sparky-lts49-amd64 cannot be found at /lib/modules/4.9.337-sparky-lts49-amd64/build or /lib/modules/4.9.337-sparky-lts49-amd64/source.
Please install the linux-headers-4.9.337-sparky-lts49-amd64 package or use the --kernelsourcedir option to tell DKMS where it's located.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-4.9.337-sparky-lts49-amd64
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
depmod: WARNING: could not open modules.builtin.modinfo at /var/tmp/mkinitramfs_ihqgDy/lib/modules/4.9.337-sparky-lts49-amd64: No such file or directory
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found background image: /opt/artwork/sparky-grub.png
Found linux image: /boot/vmlinuz-6.1.0-5-amd64
Found initrd image: /boot/initrd.img-6.1.0-5-amd64
Found linux image: /boot/vmlinuz-6.1.0-3-amd64
Found initrd image: /boot/initrd.img-6.1.0-3-amd64
Found linux image: /boot/vmlinuz-4.9.337-sparky-lts49-amd64
Found initrd image: /boot/initrd.img-4.9.337-sparky-lts49-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
dpkg: error processing package linux-image-4.9.337-sparky-lts49-amd64 (--configure):
installed linux-image-4.9.337-sparky-lts49-amd64 package post-installation script subprocess returned error exit status 1
Setting up virtualbox-7.0 (7.0.6-155176~Debian~bullseye) ...
debconf: unable to initialize frontend: Gnome
debconf: (Can't locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151.)
debconf: falling back to frontend: Dialog
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Processing triggers for bamfdaemon (0.5.6+repack-1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1.1) ...
Processing triggers for shared-mime-info (2.2-1) ...
Processing triggers for mailcap (3.70+nmu1) ...
Errors were encountered while processing:
linux-image-4.9.337-sparky-lts49-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up linux-image-4.9.337-sparky-lts49-amd64 (4.9.337-1) ...
dkms: running auto installation service for kernel 4.9.337-sparky-lts49-amd64:Sign command: /lib/modules/4.9.337-sparky-lts49-amd64/build/scripts/sign-file
Binary /lib/modules/4.9.337-sparky-lts49-amd64/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 4.9.337-sparky-lts49-amd64 cannot be found at /lib/modules/4.9.337-sparky-lts49-amd64/build or /lib/modules/4.9.337-sparky-lts49-amd64/source.
Please install the linux-headers-4.9.337-sparky-lts49-amd64 package or use the --kernelsourcedir option to tell DKMS where it's located.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-4.9.337-sparky-lts49-amd64
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
depmod: WARNING: could not open modules.builtin.modinfo at /var/tmp/mkinitramfs_LFekM0/lib/modules/4.9.337-sparky-lts49-amd64: No such file or directory
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found background image: /opt/artwork/sparky-grub.png
Found linux image: /boot/vmlinuz-6.1.0-5-amd64
Found initrd image: /boot/initrd.img-6.1.0-5-amd64
Found linux image: /boot/vmlinuz-6.1.0-3-amd64
Found initrd image: /boot/initrd.img-6.1.0-3-amd64
Found linux image: /boot/vmlinuz-4.9.337-sparky-lts49-amd64
Found initrd image: /boot/initrd.img-4.9.337-sparky-lts49-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
dpkg: error processing package linux-image-4.9.337-sparky-lts49-amd64 (--configure):
installed linux-image-4.9.337-sparky-lts49-amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.9.337-sparky-lts49-amd64


Note: This is a pc I frequently experiment with. I have installed and uninstalled many other Destop environments on this pc, and this may have something to do with the problem? I am mostly running XFCE currently. I probably have bits and pieces of other DE's that weren't 100% uninstalled. My splash screen was changed from the SparkyLinux splash to Debian 12 splash as it prompted Y/N during one of the recent updates and the result was changing of the splash screen, this bit is probably unrelated to my current VirtualBox problem. So far This seems to be the only affected software other than errors coming in the SparkyUpdate concerning Kernel.

SparkyBookworm

This is odd, even though package manager told me during installation that the installation failed, the VirtualBox software after restart is now there and is now "mostly" functional?... after restarting the Pc again, that is. The VirtualBox software still starts up with the error:

Failed to enumerate host USB devices.
VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group. Please see the user manual for a more detailed explanation.
Result Code:
NS_ERROR_FAILURE (0X00004005)
Component:
HostWrap
Interface:
IHost {e54...

THEN When I start up the VM iso it now works... ? I am baffled by this. My fumbling around seems to have partially remedied the problem? I feel so clueless.

I do not know enough about this issue to say that it is [Solved]... I have no idea what just happened even though the VM now runs in VirtualBox, whereas before it continuously failed to.

DEFINITELY NOT [SOLVED] PLEASE SEE BELOW!

SparkyBookworm

The problem went from bad to worse.

The last routine Sparky Update failed in the middle of the process and the Pc froze and became unresponsive. This is possibly due to Wi-Fi failure of the Pc in the middle of an update? Very bad timing.

Restart of Pc did not help. Now Grub has gone full retard. I am stuck at the "Minimal BASH-like editing is supported" grub command line without Sudo.

My linux installation is on (hd0,gpt2)

How do I bypass this Grub? I've been meaning to transfer any useful files off this Pc anyway for a fresh re-installation of Linux.

I don't need a permanent fix just a way to boot up the Linux one last time.

SparkyBookworm

My grub is version 2.06-8 so looks different than in this pic included only for a reference of where my pc is currently stuck at:


grub> ls
(proc) (memdisk) (hd0) (hd0,gpt2) (hd0,gpt1)

THEN

grub> set root=(hd0,gpt2)
grub> set prefix=(hd0,gpt2)/boot/grub
grub> insmod normal
grub> normal

output/result: Sends me right back to Grub "bash-like" prompt (exactly where I started) instead of booting the system.

Using (hd0,gpt1) gave same result.

(memdisk) is fat, so I may as well try that next... nope, that didn't work either.

SparkyBookworm

grub> cat (hd0,gpt2)/etc/issue
SparkyLinux 7 Orion-Belt \n \l

So its definitely (hd0,gpt2) that I must convince the wretched "Grub" to boot..

SparkyBookworm

Does anyone know if this site is good for the problem I'm facing?
https://www.linuxfoundation.org/blog/blog/classic-sysadmin-how-to-rescue-a-non-booting-grub-2-on-linux

I have no idea what version vmlinuz I'm on or init to type in, how or where to look these up using the Grub command line..

SparkyBookworm

I guess this listed here below is my vmlinuz and init info?

I input:

grub> ls (hd0,gpt2)/boot

grub responds with:
efi/ grub/ System.map-6.1.0-5-amd64 config-6.1.0-3-amd64 vmlinuz-6.1.0-3-amd64 config-6.1.0-5-amd64
vmlinuz-6.1.0-5-amd64 config-4.9.337-sparky-lts49-amd64 System.map-6.1.0-3-amd64
vmlinuz-4.9.337-sparky-lts49-amd64 initrd.img-6.1.0-5-amd64 initrd.img-6.1.0-3-amd64
System.map-4.9.337-sparky-lts49-amd64 initrd.img-4.9.337-sparky-lts49-amd64

SparkyBookworm

grub> set root=(hd0,gpt2)
grub> linux /boot/vmlinuz-6.1.0-5-amd64 root=/dev/sda1
grub> initrd /boot/initrd.img-6.1.0-5-amd64
grub> boot

This got me out of the grub and into BusyBox v1.35.0 (Debian 1:1.35.0-4+b2) built-in shell (ash), but then the mount failed giving:

mount:mounting /dev/sda1 on /root failed: No such device
Failed to mount /dev/sda1 as root file system

I don't think I should have used root=/dev/sda1... In fact I doubt I have such directory, I don't have my entire Linux file system memorized of course, so these are just stabs in the dark.

I am now at a blinking BusyBox command prompt:
(initramfs) _

Fun. But I don't know if this is an improvement but certainly was not the result I was hoping for. I'll probably have to restart and try again with Grub command line and instead use /boot as root= ?

I'm unsure what I should use.

SparkyBookworm

root=/root did not work, sent me to BusyBox prompt
root=/ did not work, sends me to BusyBox prompt
root=/boot did not work, sends me to BusyBox prompt
root=/boot/efi did not work, BusyBox prompt
root=/dev took longer didn't work, BusyBox prompt
root=/boot/grub didn't work, still stuck at BusyBox prompt



SparkyBookworm

root=/dev/sda -> BusyBox

root=/dev/sda2 -> IT WORKED.

I don't recall having such a directory. But this solution is what at least allowed me to bypass the wretched Grub:

grub> set root=(hd0,gpt2)
grub> linux /boot/vmlinuz-6.1.0-5-amd64 root=/dev/sda2
grub> initrd /boot/initrd.img-6.1.0-5-amd64
grub> boot


Now that I am logged into the desktop environment I should probably figure out what is going on with the Grub... and attempt to fix it.

SparkyBookworm

So I was able to re-run the update that the Wifi card must have dropped midstream and cause this issue. I can once again restart the Pc without the grub issue, however, there are still error! warning messages that pop up concerning the kernel 4.9.337 during the routine Sparky updater process.

I don't know why this is, but the problem seems to at least be associated with this recent error message, at least for me.

SparkyBookworm

I'm NO LONGER Stuck in the Grub rut, however, the kernel issue that increased in frequency during this issue is not yet resolved or understood by me.

I'm still getting kernel 4.9.337 errors during EVERY routine Sparky update on this XFCE Sparky Semi-rolling installation. Other than that no other serious issues.

My suspicion is that the Grub problem was due to my wifi hardware failing during routine sparky updates.  However, the Kernel 4.9.337 errors that became more frequent during this wifi dropping signal problem during an update is still not understood or resolved.

I am not good at managing my kernels. This is a major reason why I ditched arch linux for something far more sane to manage such as a Debian based distribution. I know I should have chosen a stable instead of a rolling or semirolling but I like the rolling model of SparkyLinux too much and have no intent to abandon this awesome distribution due to my incompetence concerning managing my kernels. I know this is something I need to learn, but can't currently devote the time to doing so. I believe I have maybe 3 kernels currently installed on this installation... and this is likely influenced by the multiple softwares I have installed... On Arch you manage your own kernels and for new user this sucks so i appreciate that Debian distributions seem to attempt to manage this issue based on the horrible software downloading practices I have chosen to make (such as installing and uninstalling various desktop environments on the same system) . I will try to figure this out on my own but can't give any guarantee I will eventually get to doing so.

My wifi hardware still sucks bad;y, but I'm almost used to old crappy hardware designed to run on a proprietary crappy windows driver that doesn't even work on Windows, lol.



View the most recent posts on the forum