5

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?

Kris Harper
  • 13,397
  • 12
  • 56
  • 73
Hossain Alhaidari
  • 797
  • 3
  • 8
  • 13

2 Answers2

8

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
Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
hhlp
  • 41,392
  • 18
  • 84
  • 133
1

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.

Pablo Zubieta
  • 518
  • 4
  • 10
  • You should never use normal sudo to start graphical applications as Root -> https://help.ubuntu.com/community/RootSudo – hhlp Oct 19 '11 at 18:02