This clip shows how to solve the problem with "No protocol specified" on Ubuntu 17.10.
andrew@u1710d:~$ sudo synaptic
No protocol specified
Unable to init server: Could not connect: Connection refused
(synaptic:1669): Gtk-WARNING **: cannot open display: :0
andrew@u1710d:~$
andrew@u1710d:~$ sudo gedit
No protocol specified
Unable to init server: Could not connect: Connection refused
(gedit:1673): Gtk-WARNING **: cannot open display: :0
andrew@u1710d:~$
***
Playlist with my clip about Ubuntu 17.10 • Ubuntu 17.10