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

I followed the steps from here >>

everything was going good till I reached this point.

after I found the following lines in the file

CFLAGS   ?= -g -W -Wall -Werror -O3

and edited it to make it like this >>

CFLAGS  ?= -g -W -Wall -O3

But then I am supposed to save the file, how?. when I close the terminal I was expecting them to prompt 'save file before exit' but it does not, theres just 2 options 'cancel' and 'close terminal'


share|improve this question
up vote 2 down vote accepted

In short, press Esc to get out of insert mode, and then do :wq to write the file and quit.

But in general you don't have to use vi - when you see it in instructions on the web, use nano (edit in terminal) or gedit (GUI editor) instead. When you typed:

vi common.mak

You were launching the vi editor to edit the file common.mak. Instead you could do:

nano common.mak


gedit common.mak

to edit the file in an editor that doesn't require learning to do simple things like saving a file.

Or if you want to learn vi then type vimtutor at the command line - that will get you to the point where you can be reasonably efficient with vi. If you find you like vi and want to learn lots more then read this post.

share|improve this answer
FYI vi is a program, that is editing the file common.mak. To use nano as the answer suggests, type nano common.mak. Or gedit common.mak, etc. FWIW, vi (and vim, which is an improved version) are not intuitive, but if you learn them, they are very powerful. I use vim all the time. – David Oneill May 8 '12 at 12:12
@DavidOneill: thanks - I've updated my answer to make it clearer as you suggest. – Hamish Downer May 8 '12 at 12:20
Thanks Hamish & David I could edit successfully :) – Mohd Arafat Hossain May 8 '12 at 12:25

use sudo gedit common.mak and save it. I have done it in my video

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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