As per the instruction for PSET7 I need to do execute the following in the terminal window.

sudo gedit /etc/hosts

In order to make changes in "read-only" file

Executing the above give me this error

No protocol specified

** (gedit:24020): WARNING **: Could not open X display
No protocol specified

(gedit:24020): Gtk-WARNING **: cannot open display: :0.0

How should I deal with this issue

3 Answers 3


Per the pset, the GTK warning is a known bug in Linux fedora. Prof. Malan instructs students encountering this error to try restarting their appliance and try the sudo command again. I had the same error and restarting the appliance and trying again worked for me.


You may want to read carefully instructions posted here, but only apply those "patches" if you feel confident messing around with config files.

And always create backups first (as in cp file1 file1.bak)


or you could just use nano or one of the dozen or so other text editors included in fedora (eg sudo nano /etc/hosts). the hosts file is usually 0-10 lines long, so gedit is kindof a bit much. before this class I had used centos, fedora and redhat linux for about 10 years or so for work and never once had I ever used a graphical text editor in any of them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .