启动ubuntu停在grub页面,并出现Minimal BASH-like line editingis supported解决方法

写在前面

本文主要转载
安装ubuntu出现Minimal BASH-like line editingis supported.解决方法 https://blog.csdn.net/weixin_43878078/article/details/108940936

自己使用 《二、解决方法:临时进入方法》 就解决了自己的问题。对于自己来说,这个方法也算是永久解决方法…

一、问题描述

做ubuntu系统的时候,重启之后进入系统就停在了grub页面,并且出现以下错误:

Minimal BASH-like line editing is supported.For the first word.TAB lists possible command completions.Anywhere else TAB lists possible device or file completions.

grub> 

在这里插入图片描述

这个错误主要原因是引导出错,需要修复。为了不出错,先进bios关闭uefi,
下面是解决方案:

二、解决方法:临时进入方法

出现这个问题并不是引导丢失,只是出现了错误

  1. 先使用ls命令,找到Ubuntu的安装在哪个分区:
grub>ls

会罗列所有的磁盘分区信息,比方说:(hd0,gpt1),(hd0,gpt5),(hd1,gpt3),(hd1,gpt2)

  1. 然后依次调用如下命令: X表示各个分区号码
    如果/boot没有单独分区,用以下命令:
ls (hd0,gptX)/boot/grub

这里需要一个一个分区的测试,如果出现unknow file 表示这个不是,换下一个,直到出现列出来几百个文件,很多文件的扩展名是.mod和.lst和.img,还有一个文件是grub.cfg。假设找到(hd0,gpt5)时,显示了文件夹中的文件,则表示Linux安装在这个分区.

  1. 如果找到了正确的grub目录,则设法临时性将grub的两部分关联起来,方法如下:
grub>set root=(hd0,gpt5)

grub>set prefix=(hd0,gpt5)/boot/grub
  1. 然后调用如下命令,就可以显示出丢失的grub菜单了。
grub>normal

然后会出来启动的图形界面,点击进入Linux中,对grub进行修复。
进入ubuntu之后,在终端执行:

sudo update-grub
sudo grub-install /dev/sda #(sda是你的硬盘号码,千万不要指定分区号码,例如sda1,sda5等都不对)

重启电脑测试是否已经恢复了grub的启动菜单。

三、解决方法:永久修复方法

在 《二、解决方法:临时进入方法》 的基础上,进入系统后继续操作,先联网。
打开Terminal,安装boot repair软件。输入:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair

再开一个终端,输入

boot-repair

回车打开它,点击recommanded repair(中文:推荐修复)按钮,类似与下图。
在这里插入图片描述

接下来按照提示修复即可。
在这里插入图片描述

修复完成后,需要按照提示重启计算机。

参考链接:
[1] 安装ubuntu出现Minimal BASH-like line editingis supported.解决方法 https://blog.csdn.net/weixin_43878078/article/details/108940936
[2] 安装完Ubuntu启动时自动进入grub命令行模式的解决办法 https://blog.csdn.net/wzz678678/article/details/80644181
[3] 重装Ubuntu后开机停在Grub命令行的解决办法 https://blog.csdn.net/weixin_44481159/article/details/109240338

### Minimal BASH-like Line Editing Support in Shell Environments Minimal BASH-like line editing provides users with a set of keyboard shortcuts and commands that facilitate easier command-line interaction within shell environments. This feature allows for more efficient navigation, editing, and recall of previous commands without the need to fully rely on external tools or complex configurations. In many Unix-like operating systems, including Linux distributions and macOS, shells such as Bash (Bourne Again SHell), Zsh (Z-shell), and others offer built-in support for this functionality through readline libraries[^1]. These libraries enable features like: - **Command History Navigation**: Using arrow keys (`↑` `↓`) to scroll through previously entered commands. - **Text Movement Shortcuts**: Utilizing Ctrl+A (move cursor to beginning of line) and Ctrl+E (move cursor to end of line). - **Word-based Editing**: Employing Alt+B (move backward one word) and Alt+F (move forward one word). For demonstration purposes, consider an example where a user wants to edit a long command string interactively using these minimal BASH-like keybindings inside any compatible terminal session: ```bash $ python manage.py runserver --settings=myproject.settings.local ``` If the user needs to modify part of this command quickly, instead of retyping everything from scratch, they can use combinations mentioned above to navigate around efficiently before pressing Enter again to execute it anew after modifications are done. Additionally, some advanced shells provide even richer sets of functionalities beyond basic ones provided by default settings; however, those enhancements usually require additional configuration steps not covered under 'minimal' scope here discussed[^2].
评论 27
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值