update-grub fails with 'Syntax error at line 194'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have followed the tutorial https:/
The culprit seems to be the following section in /etc/grub.
```
if [ -n "$boot_devices" ]; then
for device in ${boot_devices}; do
echo "${submenu_
echo "$(prepare_
echo "${submenu_
done
else
```
In my situation, this section generated an empty 'then' section in /boot/grub/grub.cfg in each menu entry:
```
if [ ${boot_device} = /dev/mapper/
fi
```
Adding an `echo ":"` in /etc/grub.
```
if [ -n "$boot_devices" ]; then
for device in ${boot_devices}; do
echo "${submenu_
echo ":"
echo "$(prepare_
echo "${submenu_
done
else
```
[Environment]
Ubuntu 22.04.3 LTS
grub-efi-
Installed: 1.187.6+
Candidate: 1.187.6+
Version table:
*** 1.187.6+
500 http://
500 http://
100 /var/lib/
1.
500 http://
I hope this helps!
There is a similar bug to this, involving the same file, but that is for 19.03 and the fix and cause of the error seem to be different.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: grub-common 2.06-2ubuntu7.2
ProcVersionSign
Uname: Linux 6.5.0-14-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
Date: Tue Jan 30 20:02:36 2024
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile.