Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
Error: invalid environment block. Press any key to continue...

The error message appears immediately after the boot screen on purple background. Ubuntu 12.04.1 LTS.

share|improve this question
Have you tried pressing a key to continue? Also, is this on the installation CD or after you install? – hexafraction Sep 22 '12 at 19:57
This might help. – Marty Fried Sep 22 '12 at 19:59
After pressing a key, booting is continuing, even with pressing no key after few seconds. It's after install. – Tim Sep 22 '12 at 20:02
If it continues to boot, there really is no serious problem, is there? "If it ain't[sic] broke, don't fix it!" – hexafraction Sep 22 '12 at 20:39
On Ubuntu 12.04.4 there's no line saying save_env recordfail There's one saying just recordfail. Shall I delete it anyway? – poumtatalia Apr 16 '14 at 19:14
up vote 9 down vote accepted


Press E at the GRUB menu. Find the line saying save_env recordfail and delete all of it with the Del or Backspace key. Press Ctrl+X to boot, and then open the Terminal by searching it in the dash(launcher menu).

Run the following command, and then when it asks for your password, type it, and press Enter. Your password will not be shown, not even asterisks.

sudo -i

Then, run each command, one-by-one.

cd /boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
grub-editenv grubenv list

The second-to-last command should show default=0. If it does, run the last command, and let it finish. When it finishes, you should get the prompt /boot/grub# or something like that again(it's what you see after each command). Run exit twice, and then reboot.

share|improve this answer
How do I find the GRUB menu? Must I create sudo passwd root for sudo -i? – Tim Sep 22 '12 at 20:18
The GRUB menu can be found by holding Shift while the system is in the early stages of booting (right through BIOS). The password you give to sudo -i is your USER password, not the root password. – hexafraction Sep 22 '12 at 20:30
in my boot configuration there is only one line saying recordfail. I deleted it but still can't get it to boot up – Lưu Vĩnh Phúc Aug 19 '14 at 3:52
@LưuVĩnhPhúc I know it's probably too late for you, but I just had the same problem as you. The options seem to have changed slightly in 14.04. I used to get it to a state where it boots past the error message, and then followed the above instructions to permanently remove the error itself. – Martin KS Dec 20 '15 at 21:40

protected by Community Mar 16 '14 at 12:24

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.