sudo update-grub: *******#: no encontrado

sudo update-grub: *******#: no encontrado

Quería editar mi archivo de configuración de GRUB y solía sudo update-grubactualizarlo, pero obtuve el resultado:

Sourcing file `enter code here`/etc/default/grub
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: *******#: not found

Esos * son algunos números similares a la contraseña de mi cuenta. También lo intenté sudo update-grub2pero tampoco funcionó. ¿Qué puedo hacer?

Respuesta1

No hay nada malo con el comando update-grub(que en realidad es un pequeño atajo para el comando grub-mkconfig -o /boot/grub/grub.cfg) en su sistema. Simplemente insertaste texto basura en tu /etc/default/grubarchivo de alguna manera cuando lo estabas editando:

zanna@toaster:~$ sudo update-grub
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: junk: not found

En mi caso junk, está en la línea 35. En su caso, está en la línea 1. O insertó el texto incorrecto al principio o sobrescribió todo el archivo.

Probablemente pueda solucionar este problema editando el archivo nuevamente y eliminando la línea que contiene *******(o lo que sea que represente en su pregunta) y cualquier otra línea que haya insertado y que no debería estar allí.

Por lo general, encontrará la versión del archivo del mantenedor del paquete descargada más recientemente para su sistema en /var/lib/ucf/cache/:etc:default:grub. Puede leer este archivo ejecutando, por ejemplo:

cat /var/lib/ucf/cache/:etc:default:grub

Puede ver las diferencias entre su archivo editado y este ejecutando, por ejemplo:

diff /var/lib/ucf/cache/:etc:default:grub /etc/default/grub

Y en el peor de los casos, si necesita reemplazar el que falta o está roto, /etc/default/grubpuede usar este comando (tenga en cuenta quelo existente /etc/default/grubse sobrescribe silenciosamente con este comando).

sudo cp /var/lib/ucf/cache/:etc:default:grub /etc/default/grub

Respuesta2

Compruebe que el archivo /etc/default/grubexista. Si no, cree uno, por ejemplo como se muestra a continuación:

# 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=hidden
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"

Puedes probar:

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

Consulte tambiéneste hilo de los foros de Ubuntu.

información relacionada