|

Fix Minimal BASH like line editing is supported GRUB Error In Linux

The other day when I installed Elementary OS in dual boot with Windows, I encountered a Grub error at the reboot time. I was presented with command line with error message:

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.

Minimal BASH like line editing is supported

Indeed this is not an error specific to Elementary OS. It is a common Grub error that could occur with any Linux OS be it Ubuntu, Fedora, Linux Mint etc.

In this post we shall see how to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu based Linux systems.

You can read this tutorial to fix similar and more frequent issue, error: no such partition grub rescue in Linux

Prerequisites

To fix this issue, you would need the followings:

  • A live USB or disk of (preferably) the same Linux distribution
  • A working internet connection in the live session

Once you make sure that you have the prerequisites, let’s see how to fix the black screen of death for Linux (if I can call it that ;)).

Fixing “minimal BASH like line editing is supported” Grub error

The process is simple if you follow the steps carefully (not blindly). You may have to change the partition names as per your system.

Step 1: Boot in to the live Linux USB.

Step 2: You need to find out iif your system uses EFI or BIOS. To do that, open the terminal and use the following command to list your partitions:

sudo fdisk -l

Look closely in its output because it could be a huge output. If you see something like EFI, it’s an indication that your system has EFI. This information is important in later stages.

Device        Start       End   Sectors   Size Type
/dev/sda1      2048    976895    974848   476M EFI System
/dev/sda2    976896  40038399  39061504  18.6G Linux filesystem
/dev/sda3  40038400  79099903  39061504  18.6G Linux filesystem
/dev/sda4  79099904 468875263 389775360 185.9G Linux filesystem

You need to note two things here. The partition where EFI is installed (if it is installed) and the partition where root partition is installed.

Step 3 (for UEFI systems only): Now, what you need to do is to reinstall grub.

Mount the root partition first. I am using /dev/sda2 for root but you should change this with what you have on your system:

sudo mount /dev/sda2 /mnt

If you have EFI system, mount that partition as well:

sudo mount /dev/sda1 /mnt/boot/efi

Now, the next step is to finally install grub for UEFI system like this:

sudo grub-install --boot-directory=/mnt/boot --bootloader-id=ubuntu  --target=x86_64-efi --efi-directory=/mnt/boot/efi  

Restart Ubuntu Linux using this command:

shutdown -r now

You should have the grub back to normal.

Step 3 (only for non-EFI system): Installing grub on non-EFI system is even easier.

Mount the root partition of Linux:

sudo mount /dev/sda1 /mnt

And then install grub:

sudo grub-install /dev/sd1

Reboot and it should be fine.

Alternate method to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu based Linux

I know that you might point out that this Grub error is not exclusive to Ubuntu or Ubuntu based Linux distributions, then why am I putting emphasis on the world Ubuntu? The reason is, here we will take an easy way out and use a tool called Boot Repair to fix our problem. I am not sure if this tool is available for other distributions like Fedora. Without wasting anymore time, let’s see how to solve minimal BASH like line editing is supported Grub error.

Step 1: Boot in lives session

Plug in the live USB and boot in to the live session.

Step 2: Install Boot Repair

Once you are in the lives session, open the terminal and use the following commands to install Boot Repair:

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

Note: Follow this tutorial to fix failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs error, if you encounter it while running the above command.

Step 3: Repair boot with Boot Repair

Once you installed Boot Repair, run it from the command line using the following command:

boot-repair &

Actually things are pretty straight forward from here. You just need to follow the instructions provided by Boot Repair tool. First, click on Recommended repair option in the Boot Repair.

boot repair in Ubuntu Linux

 It will take couple of minutes for Boot Repair to analyze the problem with boot and Grub. Afterwards, it will provide you some commands to use in the command line. Copy the commands one by one in terminal. For me it showed me a screen like this:

Fixing Grub issue in Ubuntu Linux

It will do some processes after you enter these commands:

minimal bash like editing

Once the process finishes, it will provide you a URL which consists of the logs of the boot repair. If your boot issue is not fixed even now, you can go to the forum or mail to the dev team and provide them the URL as a reference. Cool, isn’t it?

Boot repair successful finish

After the boot repair finishes successfully, shutdown your computer, remove the USB and boot again. For me it booted successfully but added two additional lines in the Grub screen. Something which was not of importance to me as I was happy to see the system booting normally again.

fixed Minimal BASH like line editing is supported error

Did it work for you?

So this is how I fixed minimal BASH like line editing is supported Grub error in Elementary OS Freya. How about you? Did it work for you? Feel free to ask a question or drop a suggestion in the comment box below.

Similar Posts

  • I have this issue after install Deepin OS in SSD, dualboot with Windows 10 in HDD. The installation is success but when i try to start my Laptop, this thing show up :

    GNU GRUB version 2.04
    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>

    I have to text “exit” and boot to Windows 10, i cant boot Deepin OS. I check Disk Partition and i see the SSD have alocated size same like I set at Installation before. And than i check the Sata config in BIOS to boot from Deepin. But i cant see my SSD, the sata1 is empty. After that I delete the Linux and the sata1 is appear.

    I try to install Ubuntu, but when I have to remove the USB Installation, it give me the same problem even the Installation not complete yet. Do you know how to fix this??

  • First I tried the 1st solution and it didn’t work, then I tried the alternative solution and after I had clicked the recommended repair in boot-repair it was applying changes
    So I waited, 1 hour passed and it was still loading and then I slept and woke up in the next morning and it was still loading. I don’t think it should take that much amount of time, so i closed it. Can you please help me on this.

  • Life saver; Ubuntu 22.10 got interrupted by power outage and broke with the error message above. This process seems to have recovered the interrupted installation in full and continued outstanding upgrades.

  • Hey there ,
    Recently my CPU stopped working so I got it fixed and the moment I turned it on it shows a black window stating-

    GNU GRUB version 2.02
    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>

    I don’t have any idea how to fix this as I’m new to linux.
    I read a few articles related to that But the thing is I’ve no idea that after doing this I’ll have my data the way it is …. or if I’ll lose all the data .

    Can you tell me a safe way to fix this issue without formatting or without deleting the data on hard disk ….or at least a way to save my data … like getting it’s backup or something??

    • There are a couple of ways.

      Use a live Linux USB and then use it to copy the data on another external USB disk. This way, you secure the data first.

      Next, you can use the same live USB to fix the boot issue with grub rescue and other programs.