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 want to edit the /etc/X11/xorg.conf file but I can't save the file. It says "permission denied."

How can I edit the file?

share|improve this question
up vote 5 down vote accepted

Open a Terminal and then :

Open with Gedit...

gksudo gedit /etc/X11/xorg.conf

open with nano...

sudo nano /etc/X11/xorg.conf

now you can edit ..

P.D make a backup before change the file so you can revert your modification...

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
share|improve this answer

Probably you're trying to edit the file without permissions. First make a backup of your file in case something goes wrong.

sudo cp /etc/X11/xorg.conf{,.bk}

Then, you can edit the file with you text editor, for example

gksudo gedit /etc/X11/xorg.conf

And save it.

share|improve this answer
You should never use normal sudo to start graphical applications as Root -> – hhlp Oct 19 '11 at 18:02
Thanks for the info! I'll change the answer. – Pablo Zubieta Oct 19 '11 at 18:12

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.