New kernel doesn't appear on GRUB after installation

Hi, I tried to install the new kernel version 6.0 and 6.1 using the GUI. They don’t appear on the GRUB menu and also I have this error when installing via terminal:

(4/4) Updating Grub-Bootmenu
/etc/default/grub: line 1: GRUB_DEFAULT=saved: command not found
error: command failed to execute correctly

The command in question was: sudo mhwd-kernel -i linux60

It seems like this same error: /etc/default/grub: line 1: GRUB_DEFAULT=saved: command not found

However I tried to rewrite manually line 1 with a number instead of a string, then back to a string again and nothing changed.
Also, on the GRUB menu there are a bunch of kernels that I don’t even have installed and 6.0, 6.1 don’t appear at all.

How did you write it? Are there non-printable characters inside?

cat -A /etc/default/grub

I used mousepad to write it and re-write, probably not the best option.

Here’s the output of: cat -A /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=b9098bba-74b7-462b-a07f-118d2fbcec70"$
# If you want to enable the save default function, uncomment the following$
# line, and set GRUB_DEFAULT to saved.$
# Preload both GPT and MBR modules so that they are not missed$
GRUB_PRELOAD_MODULES="part_gpt part_msdos"$
# Uncomment to enable booting from LUKS encrypted devices$
# Uncomment to use basic console$
# Uncomment to disable graphical terminal$
# The resolution used on graphical terminal$
# note that you can use only modes which your graphic card supports via VBE$
# you can see them in real GRUB with the command `vbeinfo'$
# Uncomment to allow the kernel use the same resolution used by grub$
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter$
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"$
# Uncomment to disable generation of recovery mode menu entries$
# Uncomment and set to the desired menu colors.  Used by normal and wallpaper$
# modes only.  Entries specified as foreground/background.$
export GRUB_COLOR_NORMAL="magenta/black"$
export GRUB_COLOR_HIGHLIGHT="light-cyan/black"$
# Uncomment one of them for the gfx desired, a image background or a gfxtheme$
# Uncomment to get a beep at GRUB start$
#GRUB_INIT_TUNE="480 440 1"$
# Uncomment this option to enable os-prober execution in the grub-mkconfig command$

When pasting terminal output, add three backticks ` OR 3 tilde ~ above and below the text:


I did it this time for you. Please do it like this in the future.

Thank you :bowing_man:

As you see:

Non-printable characters at the beginning.

1 Like

Thanks for your corrections on my behalf, as you might notice there’s a lot of stuff that I’m not aware of.
As for the non-printable characters I still don’t quite get what should I do, could you elaborate a bit? or point me to some reading?

Look, when I search for M-oM-;M-? I get quite good answers: You have written the file in DOS style, not in UNIX style. Obviously… Linux cannot work with DOS style correctly.

Did you edit it with notepad in wine or windows recently?

There is a tool: dos2unix, which should convert it.

Ok I think I’m getting somewhere. No, I didn’t edit the file with notepad nor I used wine. I don’t know why it got written in DOS style since I only used mousepad and I have manjaro as my base system.
I’m not even using a virtual machine. I guess I’m gonna give dos2unix a shot to convert it and hope for the best.

I’m gonna mark your reply as a solution, yes, dos2unix was the answer after all.
By the way I appreciate your patience for helping me. I’m using kernel linux 61 as of now.
Thank you very much.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.