You are not logged in.

#1 2021-07-06 10:28:00

Huso112
Member
From: Arch Linux KDE X64 UEFI
Registered: 2021-05-31
Posts: 8

grub-mkconfig command gives error

Hi.
I installed Gentoo. So i want to add my grub and modify somethings. I opened grub customizer but it gave an error like this:

/usr/share/grub/grub-mkconfig_lib: row 288: printf: `$': invalid format character

So. I type console grub-mkconfig command and it gave this output:

Creating grub configuration file ...
Founded theme: /boot/grub/themes/ArchLinux/theme.txt
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
/usr/share/grub/grub-mkconfig_lib: row 288: printf: `$': invalid format character

What should i do?

EDIT:
Here's the wrong line:

# Run the first argument through gettext, and then pass that and all
# remaining arguments to printf.  This is a useful abbreviation and tends to
# be easier to type.
gettext_printf () {
  gettext_printf_format="$1"
  shift
  288 --> printf "$(gettext "$gettext_printf_format")" "$@"

Last edited by Huso112 (2021-07-06 10:30:22)

Offline

#2 2021-07-06 11:24:10

thehexagon
Member
From: New Zealand
Registered: 2020-10-26
Posts: 76
Website

Re: grub-mkconfig command gives error

Did you install Gentoo alongside Arch, or just Gentoo?


NZ - UTC+12, or UTC+13 (depends on DST) | HP ENVY x360 2-in-1 Laptop 15-EW0009TX

Offline

#3 2021-07-06 11:54:22

seth
Member
Registered: 2012-09-03
Posts: 59,390

Re: grub-mkconfig command gives error

stat /bin/sh

Offline

#4 2021-07-06 17:29:56

Huso112
Member
From: Arch Linux KDE X64 UEFI
Registered: 2021-05-31
Posts: 8

Re: grub-mkconfig command gives error

Oh, i solved it!

Just type:

sudo touch /usr/local/bin/grub-mkconfig ; sudo gio open /usr/local/bin/grub-mkconfig

It will open the text editor. And type this:

LC_ALL=C /bin/bash -c "/usr/bin/grub-mkconfig -o /boot/grub/grub.cfg"

After give permission to this file:

sudo chmod +x /usr/local/bin/grub-mkconfig

And try it!

sudo grub-mkconfig -o /boot/grub/grub.cfg

Reference to; https://www.technopat.net/sosyal/konu/a … t-12110027

Last edited by Huso112 (2021-07-06 17:32:50)

Offline

#5 2021-07-06 17:31:04

Huso112
Member
From: Arch Linux KDE X64 UEFI
Registered: 2021-05-31
Posts: 8

Re: grub-mkconfig command gives error

thehexagon wrote:

Did you install Gentoo alongside Arch, or just Gentoo?

I installed Gentoo Alongside Arch smile

Offline

#6 2021-07-06 18:50:13

seth
Member
Registered: 2012-09-03
Posts: 59,390

Re: grub-mkconfig command gives error

seth wrote:
stat /bin/sh

While technically any posix shell should™ do, it's in practical reality a bad idea to not have it link bash.
You'll run into this sort of situation more often and if you changed /bin/sh because you actually wanted to use "man chsh", it's also wrong.

Offline

#7 2022-11-14 15:11:44

wordlesswind
Member
Registered: 2022-11-14
Posts: 2

Re: grub-mkconfig command gives error

Simply reinstall the GRUB EFI application: https://wiki.archlinux.org/title/GRUB#Installation

for example

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

then

grub-mkconfig -o /boot/grub/grub.cfg

You will get a GRUB interface that matches the device language settings.

Last edited by wordlesswind (2022-11-14 15:22:38)

Offline

#8 2022-11-14 15:41:55

seth
Member
Registered: 2012-09-03
Posts: 59,390

Re: grub-mkconfig command gives error

The thread is nearly 1½ years old and the problem apparently was either the locale or the default shell interpreter, the consequence being that grub-mkconfig failed w/ a script error.
So nothing in your wiki parroting necrobump makes any sense.

Offline

#9 2022-11-14 16:24:09

wordlesswind
Member
Registered: 2022-11-14
Posts: 2

Re: grub-mkconfig command gives error

seth wrote:

The thread is nearly 1½ years old and the problem apparently was either the locale or the default shell interpreter, the consequence being that grub-mkconfig failed w/ a script error.
So nothing in your wiki parroting necrobump makes any sense.

But I actually ran into this problem just last month.
This problem is encountered when people change the locale setting, for example `zh_CN.UTF8`.

An identical problem when appearing in August this year: https://bbs.archlinuxcn.org/viewtopic.php?id=12793

So please maintain your respect for others and your silence on issues you don't understand.

Offline

#10 2022-11-14 16:32:55

seth
Member
Registered: 2012-09-03
Posts: 59,390

Re: grub-mkconfig command gives error

An identical problem when appearing in August this year

Yeah, no shit?
https://bbs.archlinux.org/viewtopic.php?id=279042

I'm aware of the zh_CN situation, but neither do we have any corfirmation on this being the OPs issue (and the posted output is actually English) nor does your cold necrobump to a solved topic necrobump point that out specifically.

Offline

Board footer

Powered by FluxBB