Ubuntu 14.04 gedit error cannot open display

5,073

You do not have to use gedit. Since you are on a server system, likely with only a terminal console available, you will need to either use X11 forwarding with ssh, or a terminal based editor.

To edit the file under sudo, just use sudo nano rather than gksudo. If you wish to forward your display, you can use ssh -X and then gksudo and gedit will work, but be somewhat slow, depending on your connection to the server.

Share:
5,073

Related videos on Youtube

RyanP
Author by

RyanP

Updated on September 18, 2022

Comments

  • RyanP
    RyanP over 1 year

    I'm trying to fix an apache2 error (see... Why is my Apache not working after upgrading to Ubuntu 14.04? to understand the error) but to do that I have to use gedit, now after installing gedit and using the command (shown in the link) sudo gedit /etc/apache2/sites-available/000-default.conf and I get this error... Gtk-WARNING **: cannot open display: Even if I try gksudo gedit /etc/apache2/sites-available/000-default.conf and sudo nano /etc/apache2/sites-available/000-default.conf it gives me the same message (including when I type in gksudo nano). What's the problem with this?

  • RyanP
    RyanP almost 9 years
    it still gives me the same error message
  • RyanP
    RyanP almost 9 years
    another problem is that with the "edit" command it says that I can't get access ot the file