11

I am trying to use gedit to view .conf files in Ubuntu server 16.04.2. I can't seem to do it as you can see:

$ sudo gedit /etc/network/interfaces
[sudo] password for blue: 
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(gedit:1430): Gtk-WARNING **: cannot open display: $ sudo gedit

I looked for duplicates or similar issues on this forum but it seems to point in using GUI, however I did try to use their workarounds but unfortunately I can't still use it. Anyway you can help me troubleshoot? I tried re-install but still no joy...

0

3 Answers 3

9

gedit is the official text editor of the GNOME desktop environment. Generally, in a server, there is no desktop environment installed or needed. Therefore, gedit can't start and display.

I suggest that you instead use nano.

sudo nano /etc/network/interfaces 
1
  • thanks for the tip! great help since I am using only the server and no GUI. Jun 29, 2017 at 21:29
1

Simply install GNOME:

sudo apt -y install gnome

Reboot.

Done.

1
  • 5
    Doesn't it matter to you from a security standpoint that you recommend installing the GNOME desktop environment, plus a complete range of plugins and other applications integrating with GNOME on a server?
    – karel
    Nov 14, 2019 at 3:04
0

root@TTNPL-6668:~# sudo gedit /etc/profile Unable to init server: Could not connect: Connection refused

(gedit:8613): Gtk-WARNING **: 12:17:04.209: cannot open display:

worked for this warning

Simply change user , maybe you are running this command as root run this command directly from user it will work.

You must log in to answer this question.

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