Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed updates, which included a new kernel. I went to remove one of the older kernels and got:
Code:
jnojr@DEV:~$ sudo apt-get purge linux-image-3.13.0-46-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-46-generic gir1.2-ubuntuoneui-3.0 wireless-regdb iw
linux-headers-3.13.0-46 crda linux-headers-3.5.0-23-generic lesstif2
linux-headers-3.5.0-23 libubuntuoneui-3.0-1 thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
linux-image-3.13.0-46-generic*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 197 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 340656 files and directories currently installed.)
Removing linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
Purging configuration files for linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
I have no idea how I'd "ensure there are no errors" in the /etc/grub related files... I have no idea what's supposed to be there. Looking at the line it's complaining about in /boot/grub/grub.cfg.new doesn't tell me anything. How do i find out what it's unhappy about?
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672
Rep:
How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)
I now usually try to keep at least three kernels in /boot as if I do an update which screws up, I just reboot and select an older one then remove the flakey one as above.
I think Ubuntu 12.04 may use Grub2(?) in which case check this out
Play Bonny!
Last edited by Soadyheid; 05-01-2015 at 10:46 AM.
Reason: Missed the Ops command on first read. Duh!
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="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 `vbeinfo'
#GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
The message in your initial post indicates there is a syntax error on line 146 of the /boot/grub/grub.cfg file which is why you were asked to post at least that part of it. Someone might be able to tell you what is wrong with the line if you posted it.
The message in your initial post indicates there is a syntax error on line 146 of the /boot/grub/grub.cfg file which is why you were asked to post at least that part of it. Someone might be able to tell you what is wrong with the line if you posted it.
They'd asked about /etc, not /boot.
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
set locale_dir=($root)/boot/grub/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-48-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux /boot/vmlinuz-3.13.0-48-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-48-generic
}
menuentry "Ubuntu, with Linux 3.13.0-48-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
echo 'Loading Linux 3.13.0-48-generic ...'
linux /boot/vmlinuz-3.13.0-48-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-48-generic
}
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry "Ubuntu, with Linux 3.13.0-46-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux /boot/vmlinuz-3.13.0-46-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-46-generic
}
### END /etc/grub.d/10_linux_proxy ###
### BEGIN /etc/grub.d/30_os-prober_proxy ###
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
linux /boot/vmlinuz-2.6.32-504.12.2.el6.x86_64 root=/dev/sdb1
initrd /boot/initramfs-2.6.32-504.12.2.el6.x86_64.img
}
menuentry "Windows Vista (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5E286952286929EB
chainloader +1
}
### END /etc/grub.d/30_os-prober_proxy ###
### BEGIN /etc/grub.d/31_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-46-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
echo 'Loading Linux 3.13.0-46-generic ...'
linux /boot/vmlinuz-3.13.0-46-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-46-generic
}
submenu "Previous Linux versions"{
menuentry "Ubuntu, with Linux 3.5.0-54-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux /boot/vmlinuz-3.5.0-54-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-54-generic
}
menuentry "Ubuntu, with Linux 3.5.0-54-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
echo 'Loading Linux 3.5.0-54-generic ...'
linux /boot/vmlinuz-3.5.0-54-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-54-generic
}
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
linux /boot/vmlinuz-2.6.32-504.8.1.el6.x86_64 root=/dev/sdb1
initrd /boot/initramfs-2.6.32-504.8.1.el6.x86_64.img
}
}
### END /etc/grub.d/31_linux_proxy ###
### BEGIN /etc/grub.d/33_linux_xen ###
### END /etc/grub.d/33_linux_xen ###
### BEGIN /etc/grub.d/34_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/34_memtest86+ ###
### BEGIN /etc/grub.d/35_uefi-firmware ###
### END /etc/grub.d/35_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
The end of the message suggests you also check /etc/default/grub for possible errors. The file you posted is the standard default. The error message was produced while "Generating grub.cfg" file. It specifically states a syntax error on line 146 of that file not /etc/default/grub which has no where near 146 lines. It might have been a good idea to point out that line yourself rather than waiting for someone here willing to do it.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
Post the content of /boot/grub/grub.cfg.new -- this contains the syntax error.
Please also post the content of /etc/kernel/postrm.d/zz-update-grub
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by Soadyheid
How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)
I now usually try to keep at least three kernels in /boot as if I do an update which screws up, I just reboot and select an older one then remove the flakey one as above.
I think Ubuntu 12.04 may use Grub2(?) in which case check this out
Play Bonny!
I want to point to this post as the more likely answer. I have seen pretty much the same error as the OP (I don't recall the line reported as the error but I recall the error) and simply running update-grub resolved it. I should say I am running Debian Sid not Ubuntu but my packages will be pretty close to the Ubuntu ones.
How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)
Code:
joliver@JOHN-DEV:~$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
joliver@JOHN-DEV:~$ cat /boot/grub/grub.cfg.new
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
set locale_dir=($root)/boot/grub/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-51-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux /boot/vmlinuz-3.13.0-51-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-51-generic
}
menuentry "Ubuntu, with Linux 3.13.0-51-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
echo 'Loading Linux 3.13.0-51-generic ...'
linux /boot/vmlinuz-3.13.0-51-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-51-generic
}
### END /etc/grub.d/10_linux_proxy ###
### BEGIN /etc/grub.d/30_os-prober_proxy ###
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
linux /boot/vmlinuz-2.6.32-504.12.2.el6.x86_64 root=/dev/sdb1
initrd /boot/initramfs-2.6.32-504.12.2.el6.x86_64.img
}
menuentry "Windows Vista (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5E286952286929EB
chainloader +1
}
### END /etc/grub.d/30_os-prober_proxy ###
### BEGIN /etc/grub.d/33_linux_proxy ###
submenu "Previous Linux versions"{
menuentry "Ubuntu, with Linux 3.13.0-49-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux /boot/vmlinuz-3.13.0-49-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-49-generic
}
menuentry "Ubuntu, with Linux 3.13.0-49-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
echo 'Loading Linux 3.13.0-49-generic ...'
linux /boot/vmlinuz-3.13.0-49-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-49-generic
}
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
linux /boot/vmlinuz-2.6.32-504.8.1.el6.x86_64 root=/dev/sdb1
initrd /boot/initramfs-2.6.32-504.8.1.el6.x86_64.img
}
}
### END /etc/grub.d/33_linux_proxy ###
### BEGIN /etc/grub.d/34_linux_xen ###
### END /etc/grub.d/34_linux_xen ###
### BEGIN /etc/grub.d/35_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/35_memtest86+ ###
### BEGIN /etc/grub.d/36_uefi-firmware ###
### END /etc/grub.d/36_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Line 146 is:
Code:
function gfxmode {
All open '{' are closed with '}' That is inside the 'submenu' section, maybe something's confusing it that way? But the submenu is closed as well.
Post the content of /boot/grub/grub.cfg.new -- this contains the syntax error.
I did, in post #6
Quote:
Please also post the content of /etc/kernel/postrm.d/zz-update-grub
Code:
joliver@JOHN-DEV:~$ cat /etc/kernel/postrm.d/zz-update-grub
#! /bin/sh
set -e
which update-grub >/dev/null 2>&1 || exit 0
if type running-in-container >/dev/null 2>&1 && \
running-in-container >/dev/null; then
exit 0
fi
set -- $DEB_MAINT_PARAMS
mode="${1#\'}"
mode="${mode\'}"
case $0:$mode in
# Only run on postinst configure and postrm remove, to avoid wasting
# time by calling update-grub multiple times on upgrade and removal.
# Also run if we have no DEB_MAINT_PARAMS, in order to work with old
# kernel packages.
*/postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
exec update-grub
;;
esac
exit 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.