Tried to change grub background. It turns out I can't use update-grub

Hi, I tried to change the GRUB background image and changed the /etc/default/grub file to change background. Then I tried update-grub and/or grub-mkconfig and it always tells me:

/etc/default/grub: line 1: GRUB_DEFAULT=false: command not found

What am I doing wrong? Also do you need more info from my end? I’m kinda noob you know.
Also I read that grub customizer is a big no no in manjaro, too bad i just want to customize my grub.


Edit: (since I couldn’t reply on time)
I didn’t. I read that I shouldn’t and I couldn’t install it anyway. By the way I found a way to switch the background image which is what I wanted.
I went to /usr/grub/themes/manjaro/theme.txt and realized there was an entry for a background image. What I did was search for the image i wanted copied it into the directory and changed the name to background.png
I got the idea from this: How to Change Grub2 Background Image on Manjaro, Arch Linux - YouTube
The problem might seem obvious for the more experienced users but it was obviously not for me, a link to some proper reading would be helpful.
By the way, I still can’t update grub.

Obviously that. :point_up_2:

Too bad you used it then, because it makes a mess out of your configuration and we do not support that.

1 Like

You obviously did more than just that, because of your line here… :arrow_down:

/etc/default/grub: line 1: GRUB_DEFAULT=false: command not found

false is not a valid option for GRUB_DEFAULT. That line should contain either the number (starting the count from 0) of the menu entry that is to be booted by default, or the name of said menu entry, or the keyword saved, which means that it’ll default to whatever menu entry you booted from last.

See the documentation. :arrow_down:

2 Likes

Thank you for taking more than 3 seconds reviewing my issue. Yes you are right, in my desperation I resorted to lesser trusted sources. The original value was “0” I think.
It seems that I have some reading to do. Well, at least I didn’t broke my system!

My apologies for the misunderstanding. In my defense, it is not uncommon for newbies to use grub-customizer against all of our warnings. Hence my being apprehensive about that.

Normally the Manjaro default is saved. Try setting it back to that and then run… :arrow_down:

sudo update-grub

… again.

Ok, I changed it to: GRUB_DEFAULT=“saved”
Then I ran sudo update-grub, but it keeps telling me:
/etc/default/grub: line 1: GRUB_DEFAULT=saved: command not found

On my system it doesn’t have the double quotes, but to be honest, I don’t think it matters.

Are you sure you edited the correct file, i.e. /etc/default/grub?

I dont have a solution for your current grub update problems. But changing the grub theme is easy. The default manjaro theme is located in /usr/share/grub/themes/manjaro. Its easy to modify you can replace the background.png with whatever you like, and the theme.txt controls the colors.

1 Like

In general:

  1. Be careful with old stuff on the Internet. 2018 is very old. On Manjaro, always try to confirm the steps by searching this forum.

  2. Always backup a configuration file before modifying it (grub.20220827 or grub.install or grub.bak)
    This way you can restore it or diff/meld it. When I make my first change to a config file, I add .install. Any subsequent changes I add a date.

  3. Be careful copying text from sources, there could be invisible unicode characters.

  4. Search this forum, there are similar hits.

  5. Read the documenation that is provided by the application (gnu.org has good doc) and documentation provided by the distribution or the distribution it is based on. With one caveat, make sure you are using the correct command for the distribution. Arch has good doc, Manjaro so-so, but this forum serves as the documentation in many cases. I’d view other distribution’s doc, before I look at most of the general off-the-internet. There are exceptions.

    Don’t know where the doc resides:

    • pacman -Qi <package_name>. Look for the URL label. That should be the home of the application where documentation should reside.

    • If you don’t know the package name start with: pacman -Ss <string> (it’s really a regex, but just type something that is close to the application’s name). Review the output for the package name and use in the above command.

      • The difference between pacman -Q and pacman -S. -Q searches the installed packages. The location: /var/lib/pacman/local. Do not touch these files unless fixing a rare occurrence. -S searches the local repository. The location: /var/lib/pacman/sync. I use pacman, but there are similar options in pamac CLI and pamac GUI should work too.
    • Applications have man pages. Use man -k to search the short descriptions. man pages are online. Here’s man pages at arch. Here’s man pages at kernel.org

    • Don’t know if a program is on the system: type -a <program>. Try tab-completion. Type a few characters of the program and hit tab.

    • What package owns that program: pacman -Fx <output from type_command>

    • Some applications support the --help option.

    • For completeness, Distributions and Desktops have their own documentation.

The other posts responded to grub specifics and referenced the grub documentation at gnu.org. They also touched on grub-customizer. If you search this forum, you’ll find other discussions.

3 Likes

Well in the end I did change the grub background which is the thing that made me realize the update-grub issue in the first place. I guess maybe later could get into changing fonts and whatnot but for now I’ll give it a rest. I think I need to search first on the forum and catch up with the documentation :slightly_smiling_face:

Yes, I think it was the correct file. The quote marks were also on other grub config examples I was looking

Well, depending on how badly you messed up your /etc/default/grub, you might be able to restore it with the help of mine below. I’ll include some comments which I think you may want to change. :arrow_down:

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR='Manjaro'
# Aragorn's note: the line below this one may differ slightly on your system.
GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
# Modified by Aragorn ─ only GPT on this machine, and added zstd support
# Aragorn's note: if your drive has an MBR partition table, add "part_msdos"
# to the modules below, and if you're not using btrfs, then you don't need
# the "zstd" module.
GRUB_PRELOAD_MODULES="part_gpt zstd"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# 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 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# 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"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

#Disable the OS prober
# Aragorn's note: set this to "false" if you have multiple OSs on your drive.
GRUB_DISABLE_OS_PROBER=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

I always try and look in /etc/skel/ or gitlab.manjaro.org to find configuration files.

Would this be /etc/default/grub: grub.default · master · Packages / Core / grub · GitLab.

Those are only the templates for user-level configuration files. :wink:

As weird as this may sound (and it might not even be the case), there’s a chance that if you copied+pasted a line from a website into a config file, it will appear as similar-looking (but actually different) ASCII characters that will confuse the application. (Such as underscores, hyphens, double quotes, apostrophes, etc).

1 Like

Often it is the end of line character that is messed up when copy/pasting from internet in my experience.

2 Likes