problem disabling os_prober with dpkg-reconfigure grub-pc
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
You may have missed my intent, it didn't fix the missing windows in my test, but I'll have to leave it for now cause it's late at night and check back in the morning
Mike P
Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs
Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
@fehlix your command works to stop the os-prober from running. An update-grub now only generates the entries for MX23 XFCE itself. Thanks.fehlix wrote: Fri Oct 13, 2023 5:36 amyes, in "aelse" the "a" is a sed command, which means: append a new line with all the following text.asqwerth wrote: Fri Oct 13, 2023 5:03 am No worries, I'll be your guinea pig!
Before I run the commands, the first one says:
sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober
Is it really "aelse" ?
which means:
the sed command expression
aelse\n export GRUB_DISABLE_OS_PROBER="true"
appends a new line
else\n export GRUB_DISABLE_OS_PROBER="true"
where \n is also replaced with an addtional new-line
which gives:Code: Select all
else export GRUB_DISABLE_OS_PROBER="true"
@m_pav yours seems to be the opposite problem from mine, in that you want os_prober to be enabled, to run and to detect Windows.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
Thanks, for the brave test.asqwerth wrote: Fri Oct 13, 2023 5:57 am@fehlix your command works to stop the os-prober from running. An update-grub now only generates the entries for MX23 XFCE itself. Thanks.fehlix wrote: Fri Oct 13, 2023 5:36 amyes, in "aelse" the "a" is a sed command, which means: append a new line with all the following text.asqwerth wrote: Fri Oct 13, 2023 5:03 am No worries, I'll be your guinea pig!
Before I run the commands, the first one says:
sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober
Is it really "aelse" ?
which means:
the sed command expression
aelse\n export GRUB_DISABLE_OS_PROBER="true"
appends a new line
else\n export GRUB_DISABLE_OS_PROBER="true"
where \n is also replaced with an addtional new-line
which gives:Code: Select all
else export GRUB_DISABLE_OS_PROBER="true"
@m_pav yours seems to be the opposite problem from mine, in that you want os_prober to be enabled, to run and to detect Windows.
In case some one wants to have the os-prober run always enabled - not disabled - do run
Code: Select all
sudo dpkg-reconfigure grub-pc
followed by "Next" , for BIOS-GRUB the selection of MBR-target for the bios-grub-pc boot loader should be selected.
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
@fehlix
I booted into MX23 XFCE again today and noted that the grub menu list still seemed rather long even though I ran update grub last time after running your command to help disable os_prober.
So I ran your command and then update-grub again, and got this error message in the os_prober script:
Code: Select all
$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-11-amd64
Found initrd image: /boot/initrd.img-6.1.0-11-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
Code: Select all
$ sudo apt update
Hit:1 http://deb.debian.org/debian bookworm-updates InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://it.mxrepo.com/mx/repo bookworm InRelease
Hit:6 http://shop.softmaker.com/repo/apt stable InRelease
Hit:7 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
12 packages can be upgraded. Run 'apt list --upgradable' to see them.
$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libbotan-2-19 libclutter-gtk-1.0-0 libgnome-games-support-1-3 libgnome-games-support-common
libmikmod3 libotr5 libqt6concurrent6 libqt6sql6 libqt6sql6-sqlite libqt6widgets6 librnp0
libsdl-mixer1.2 libtspi1 linux-headers-6.1.0-11-common
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-headers-6.1.0-11-amd64 linux-image-6.1.0-11-amd64
The following packages will be upgraded:
gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 google-chrome-stable libjavascriptcoregtk-4.0-18
libjavascriptcoregtk-4.1-0 libwebkit2gtk-4.0-37 libwebkit2gtk-4.1-0 mx-goodies mx-installer
mx-remaster mx-system timeshift
12 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 161 MB of archives.
After this operation, 403 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security bookworm-security/main amd64 gir1.2-webkit2-4.0 amd64 2.42.1-1~deb12u1 [102 kB]
Get:2 http://security.debian.org/debian-security bookworm-security/main amd64 gir1.2-javascriptcoregtk-4.0 amd64 2.42.1-1~deb12u1 [46.8 kB]
Get:3 http://security.debian.org/debian-security bookworm-security/main amd64 libwebkit2gtk-4.0-37 amd64 2.42.1-1~deb12u1 [20.3 MB]
Get:4 https://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 118.0.5993.88-1 [104 MB]
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 libjavascriptcoregtk-4.0-18 amd64 2.42.1-1~deb12u1 [7,529 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main amd64 libwebkit2gtk-4.1-0 amd64 2.42.1-1~deb12u1 [20.3 MB]
Get:7 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-remaster all 23.10.01mx23 [170 kB]
Get:8 http://security.debian.org/debian-security bookworm-security/main amd64 libjavascriptcoregtk-4.1-0 amd64 2.42.1-1~deb12u1 [7,529 kB]
Get:9 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-goodies all 23.09.02 [49.1 kB]
Get:10 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-installer amd64 23.10.02mx23 [518 kB]
Get:11 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-system all 23.10.01mx23 [72.9 kB]
Get:12 http://it.mxrepo.com/mx/repo bookworm/main amd64 timeshift amd64 23.07.1-1+mx23+2 [686 kB]
Fetched 161 MB in 3s (63.3 MB/s)
(Reading database ... 444442 files and directories currently installed.)
Removing linux-headers-6.1.0-11-amd64 (6.1.38-4) ...
Removing linux-image-6.1.0-11-amd64 (6.1.38-4) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: 8812au 5.13.6 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m 8812au -v 5.13.6 -k 6.1.0-11-amd64 -a x86_64
Module 8812au-5.13.6 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
8812au.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: broadcom-sta 6.30.223.271 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m broadcom-sta -v 6.30.223.271 -k 6.1.0-11-amd64 -a x86_64
Module broadcom-sta-6.30.223.271 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
wl.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: rtl8821ce 5.5.2.1+git20230504 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m rtl8821ce -v 5.5.2.1+git20230504 -k 6.1.0-11-amd64 -a x86_64
grep: /lib/modules/6.1.0-11-amd64/build/.config: No such file or directory
Deprecated feature: MODULES_CONF (/var/lib/dkms/rtl8821ce/5.5.2.1+git20230504/source/dkms.conf)
Module rtl8821ce-5.5.2.1+git20230504 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
rtl8821ce.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: rtl8821cu 5.12.0 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m rtl8821cu -v 5.12.0 -k 6.1.0-11-amd64 -a x86_64
Module rtl8821cu-5.12.0 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
8821cu.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: virtualbox 7.0.10 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m virtualbox -v 7.0.10 -k 6.1.0-11-amd64 -a x86_64
Module virtualbox-7.0.10 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
vboxdrv.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxnetadp.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxnetflt.ko:
- Uninstallation
- Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-11-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-11-amd64 (--remove):
installed linux-image-6.1.0-11-amd64 package post-removal script subprocess returned error exit sta
tus 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-6.1.0-11-amd64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
tuaz@mx23rc3:~
$ sudo dpkg -C
The following packages are only half installed, due to problems during
installation. The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
linux-image-6.1.0-11-amd64 Linux 6.1 for 64-bit PCs (signed)
tuaz@mx23rc3:~
$ sudo dpkg --remove linux-image-6.1.0-11-amd64
(Reading database ... 432992 files and directories currently installed.)
Removing linux-image-6.1.0-11-amd64 (6.1.38-4) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-11-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-11-amd64 (--remove):
installed linux-image-6.1.0-11-amd64 package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-6.1.0-11-amd64
tuaz@mx23rc3:~
$
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
Added: I am still able to reboot using the current kernel, but because of the error during kernel removal, the updates are unable to go through.
YIKES! I just realised your original post with the command said to run it only once. So I have now run it once or twice more. That's probably the problem, right?
SOLVED - I edited the os-prober script as root and removed the additional added lines.
YIKES! I just realised your original post with the command said to run it only once. So I have now run it once or twice more. That's probably the problem, right?
SOLVED - I edited the os-prober script as root and removed the additional added lines.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
++EDIT+++, ok you fixed it.asqwerth wrote: Wed Oct 18, 2023 8:55 am I booted into MX23 XFCE again today and noted that the grub menu list still seemed rather long even though I ran update grub last time after running your command to help disable os_prober.
So I ran your command and then update-grub again, and got this error message in the os_prober script:
#---------
maybe you run the command twice.
Better show how it looks now, with
Code: Select all
head -20 /etc/grub.d/30_os-prober
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
Code: Select all
$ head -20 /etc/grub.d/30_os-prober
#! /bin/sh
#tag for mx-system update
#mx-system 20.11.02+4
export LVM_SUPPRESS_FD_WARNINGS=true
if [ "x$(debconf-get-selections |grep '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
export GRUB_DISABLE_OS_PROBER="false"
else
export GRUB_DISABLE_OS_PROBER="true"
#else
# export GRUB_DISABLE_OS_PROBER="true"
#else
# export GRUB_DISABLE_OS_PROBER="true"
fi
set -e
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400
Re: problem disabling os_prober with dpkg-reconfigure grub-pc
Seems you have run it three times and added every time a new else clause.asqwerth wrote: Wed Oct 18, 2023 10:18 amI commented out what I thought were the wrongly-added extra lines (instead of deleting them), to test my solution.Code: Select all
$ head -20 /etc/grub.d/30_os-prober #! /bin/sh #tag for mx-system update #mx-system 20.11.02+4 export LVM_SUPPRESS_FD_WARNINGS=true if [ "x$(debconf-get-selections |grep '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then export GRUB_DISABLE_OS_PROBER="false" else export GRUB_DISABLE_OS_PROBER="true" #else # export GRUB_DISABLE_OS_PROBER="true" #else # export GRUB_DISABLE_OS_PROBER="true" fi set -e