Score:1

Sudo update-grub does not work (single boot Ubuntu 22.04)

tk flag

Ubuntu 22.04 KDE 5.15.0-52 Nvidia 470 proprietary. I see there is a lot of questions on this subject, but all the answers I've read, have not solved the problem. I edit the GRUB, save it, and it keeps the change. When I "sudo update-grub" it doesn't work. It gives me this read out. Sourcing file /etc/default/grub /usr/sbin/grub-mkconfig: 1: /etc/default/grub: /#: not found

-Here is the grub file, I added the lines... GRUB_SAVEDEFAULT=true GRUB_DEFAULT=saved.

/# 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_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

# 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"
GRUB_DISABLE_OS_PROBER=false

I'm trying to boot on Kernel 5.15.0-52 by default. I ignorantly did a full upgrade to 5.15.0-53 and subsequently 5.15.0-56 and now have two unneeded kernels, it will not let me purge or remove them. (errors, unsigned, etc) (Learned Nvidia proprietary and nouveau w kernel upgrades does not work) This is what I tried that taught me a lot, but the file and script is there. Everything appears to be where it is supposed to be.

The update-grub command was created to make things easier - it is simply a shell script in /usr/sbin/:

#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"

If it is not there, you can make your own. To do that, run this, and paste in the above script:

sudo nano /usr/sbin/update-grub

Save with Ctrl+O, and exit with Ctrl+X.

Then run these:

sudo chown root:root /usr/sbin/update-grub
sudo chmod 755 /usr/sbin/update-grub

And you should now be able to run update-grub. :-)

I also ran "sudo update-grub" among other minor things, but still no update-grub. Does anyone know what I'm missing?

Score:4
cn flag

Remove the very first character of the first line in /ect/default/grub, the /.

The first line should be a comment and therefor start with #. Change

/# If you change this file, run 'update-grub' afterwards to update

to

# If you change this file, run 'update-grub' afterwards to update

You should also remove the line

GRUB_DEFAULT=0

since you don't want to define GRUB_DEFAULT twice.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.