![如何禁用 Lubuntu 的图形 grub 主题](https://linux22.com/image/1187602/%E5%A6%82%E4%BD%95%E7%A6%81%E7%94%A8%20Lubuntu%20%E7%9A%84%E5%9B%BE%E5%BD%A2%20grub%20%E4%B8%BB%E9%A2%98.png)
我在我的电脑上使用 Lubuntu 22.04 LTS,正在测试 grub 编辑。
看起来 Lubuntu 正在使用某种图形界面来显示 grub。
我可以禁用它以使用与 Ubuntu 默认设置相同的功能吗?
这是我的 grub 配置文件:猫/etc/默认/grub
# 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="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER="false"
# 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
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Sourcing file `/etc/default/grub.d/lubuntu-grub-theme.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/lubuntu-grub-theme/theme.txt
Found linux image: /boot/vmlinuz-5.15.0-39-generic
Found initrd image: /boot/initrd.img-5.15.0-39-generic
Found linux image: /boot/vmlinuz-5.15.0-25-generic
Found initrd image: /boot/initrd.img-5.15.0-25-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda4@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
我可以看到它指向这两个文件:`/etc/default/grub.d/lubuntu-grub-theme.cfg' /usr/share/grub/themes/lubuntu-grub-theme/theme.txt
解决方案是否应该是删除/usr/share/grub/themes/lubuntu-grub-theme/theme.txt所以它不加载它?这能行吗?
答案1
grub 的外观由 管理/etc/grub.d/05_debian_theme
。使用 删除此文件的可执行位sudo chmod -x /etc/grub.d/05_debian_theme
/etc/grub.d/04_set-colors
创建包含以下内容的文件:
#!/bin/sh
set -e
# Set the colors of the boot-menu. Available colors are
# black
# blue
# green
# cyan
# red
# magenta
# brown
# light-gray
# dark-gray
# light-blue
# light-green
# light-cyan
# light-red
# light-magenta
# yellow
# white
echo "${1}set menu_color_normal=white/black"
echo "${1}set menu_color_highlight=black/light-gray"
使用以下命令使文件可执行sudo chmod +x /etc/grub.d/04_set-colors
最后跑了sudo update-grub
。
这将为您提供一个非常基本的 grub 菜单,具有黑色背景和您选择的文本和高亮颜色。
/etc/grub.d/04_set-colors
您可以通过删除新创建的文件、恢复可执行文件位/etc/grub.d/05_debian_theme
并再次运行来轻松撤消更改sudo update-grub
。
答案2
解决方案:
我已经能够通过删除数据包来删除主题:
apt purge lubuntu-grub-theme
。
我必须这样做update-grub
,否则我会在 grub 菜单之前收到一条消息:
/usr/share/grub/themes/lubuntu-grub-theme/theme.txt
未找到
我确认了@guiverc 的答案,并按照他/她的建议添加了发布版本。
答案3
最近我一直在处理这个问题。我正在运行 22.04.3 LTS。我发现你需要做的就是注释掉该行,然后/etc/default/grub.d/lubuntu-grub-theme.cfg
运行sudo update-grub
并重新启动。
以下命令将注释掉中的所有行/etc/default/grub.d/lubuntu-grub-theme.cfg
,然后更新 grub。
sudo sed -i 's/^/# /' /etc/default/grub.d/lubuntu-grub-theme.cfg
sudo update-grub
reboot