误删GRUB文件后执行update-grub失败、重装grub-common报错的问题求助
误删GRUB文件后执行update-grub失败、重装grub-common报错的问题求助
大家好,我遇到了GRUB相关的棘手问题,希望能得到帮助:
之前我安装了Ubuntu 20.04 LTS和Windows双系统,一开始GRUB识别不到Windows启动项,更新GRUB后问题解决了。但昨天我不小心删掉了GRUB的相关文件,现在各种操作都出问题了。
我试过用boot repair工具,但没能解决问题。现在执行sudo update-grub时,输出如下:
Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... El guión «/boot/grub/grub.cfg.new» no contiene órdenes y no hará nada 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.
我查看了init-select.cfg里的内容,是这样的:
Work around a bug in the obsolete init-select package which brokegrub-mkconfig when init-select was removed but not purged. This file doesnothing and will be removed in a later release.See:https://bugs.debian.org/858528https://bugs.debian.org/863801
而生成的grub.cfg.new内容只有注释:
DO NOT EDIT THIS FILEIt is automatically generated by grub-mkconfig using templatesfrom /etc/grub.d and settings from /etc/default/grub
之后我尝试重装grub-common,但也报错了,完整输出如下:
[sudo] contraseña para alejandro: Leyendo lista de paquetes... Hecho Creando árbol de dependencias... Hecho Leyendo la información de estado... Hecho Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios. chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi i965-va-driver intel-media-va-driver libaacs0 libaom3 libass9 libavcodec58 libavformat58 libavutil56 libbdplus0 libblas3 libbluray2 libbs2b0 libchromaprint1 libcodec2-1.0 libdav1d5 libflashrom1 libflite1 libftdi1-2 libgme0 libgsm1 libgstreamer-plugins-bad1.0-0 libigdgmm12 liblilv-0-0 libllvm13 libmfx1 libmysofa1 libnorm1 libopenmpt0 libpgm-5.3-0 libpostproc55 librabbitmq4 librubberband2 libserd-0-0 libshine3 libsnappy1v5 libsord-0-0 libsratom-0-0 libsrt1.4-gnutls libssh-gcrypt-4 libswresample3 libswscale5 libudfread0 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libx265-199 libxvidcore4 libzimg2 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers pocketsphinx-en-us va-driver-all vdpau-driver-all Utilice «sudo apt autoremove» para eliminarlos. 0 actualizados, 0 nuevos se instalarán, 2 reinstalados, 0 para eliminar y 4 no actualizados. Se necesita descargar 80,1 kB/2.268 kB de archivos. Se utilizarán 0 B de espacio de disco adicional después de esta operación. Des:1 http://es.archive.ubuntu.com/ubuntu jammy/main amd64 memtest86+ amd64 5.31b+dfsg-4 [80,1 kB] Descargados 80,1 kB en 1s (79,9 kB/s) Preconfigurando paquetes ... (Leyendo la base de datos ... 202811 ficheros o directorios instalados actualmen te.) Preparando para desempaquetar .../grub-common_2.06-2ubuntu7.1_amd64.deb ... Desempaquetando grub-common (2.06-2ubuntu7.1) sobre (2.06-2ubuntu7.1) ... Preparando para desempaquetar .../memtest86+_5.31b+dfsg-4_amd64.deb ... Desempaquetando memtest86+ (5.31b+dfsg-4) sobre (5.31b+dfsg-4) ... Configurando memtest86+ (5.31b+dfsg-4) ... Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... El guión «/boot/grub/grub.cfg.new» no contiene órdenes y no hará nada 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. dpkg: error al procesar el paquete memtest86+ (--configure): el subproceso instalado paquete memtest86+ script post-installation devolvió el código de salida de error 1 Configurando grub-common (2.06-2ubuntu7.1) ... update-rc.d: warning: start and stop actions are no longer supported; falling ba ck to defaults Procesando disparadores para man-db (2.10.2-1) ... Se encontraron errores al procesar: memtest86+ E: Sub-process /usr/bin/dpkg returned an error code (1)
现在我该怎么做才能修复这个问题呢?我的英语不太好,希望大家能理解我的描述,谢谢!
备注:内容来源于stack exchange,提问作者ale98sanchez
相关产品推荐
相关产品推荐

