Ubuntu: ubuntu 12.04 desktop Error: unknown command 'gfxmode'. Pressing any key continues


Premise: linux noobie here, I have the same issue as OP: fresh 12.04 desktop, changed grub with grub customizer, now I get a: unknown command 'gfxmode' press ...etc

was asked to "re-post" this question and link to this thread which I refer to above.

I have tried what Tarek said, and nothing seems to work, I find two lines with gfxmode:

function gfxmode {

gfxmode \$linux_gfx_mode

Note: not sure if it matter but in the error the two single quotes before gfxmode are not the same, the first is a slanted quote mark, the second (after gfxmode) is a straight one.

I commented out the whole line, I tried to add 'set' before gfxmode, neither did any difference.

I found another place that said to remove the line from another file 40_custom, but I checked and those files do not contain anything relating to the line we are looking for: gfxmode $linux_gfx_mode

Not sure what I am missing, but the file linux.save has recently appeared when searching for the line. Not sure if its just a temp file of some kind.

In any case I cannot seem to get it, what am I missing?


P.S. sorry for any messups in form :)


Try to re-install GRUB

sudo apt-get install --reinstall grub-common  sudo update-grub  

Then you can use boot-repair software to re-install GRUB. There should be no error messages any more.


I solve this problem using the same thread that you, when you remove the line, open the terminal and write:

--> sudo update-grub

1-You must erase the Line 'gfxmode \$linux_gfx_mode'. 2-Open the Terminal and write 'sudo update-grub'.

Tell me if you can solve the problem.

PD: please excuse my bad English.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »