Ask Your Question

Gtk-WARNING**:cannot open display

asked 2018-04-27 12:36:48 -0600

updated 2018-05-17 01:27:13 -0600

(gedit 4364) Gtk-WARNING**:cannot open display

while opening gedit to edit /etc/environment above error is showing.tried as a root user and as super user also.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2018-04-28 14:32:26 -0600

villykruse gravatar image

An alternative

export EDITOR=/usr/bin/gedit
sudo -e /etc/environment

run man sudo for more information.

Of course, you could also use a non-GUI editor like nano, emacs, or vim.

edit flag offensive delete link more

answered 2018-04-29 04:52:43 -0600

Period22 gravatar image

Another alternative that works in Wayland, so there's no need to change to Xorg:

gedit admin:///etc/environment
edit flag offensive delete link more


I thought there was a way to do it with gedit, but I couldn't remember what it was.

ssieb gravatar imagessieb ( 2018-05-03 17:33:02 -0600 )edit

answered 2018-04-28 12:11:15 -0600

ssieb gravatar image

If you're using Wayland (which is the default), applications running as root cannot access the display. If you must use a graphical editor like that, then choose the "Gnome on Xorg" session when logging in. There will be a little gear icon after you click on your name before you enter your password.

edit flag offensive delete link more


I begninner to linux environment, when i choose for "Gnome on xorg" it says user cant login.

duckfern gravatar imageduckfern ( 2018-04-29 07:22:26 -0600 )edit

I don't know why that would be happening, but use one of the other answers here instead.

ssieb gravatar imagessieb ( 2018-05-03 17:49:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-04-27 12:36:48 -0600

Seen: 1,417 times

Last updated: Apr 29 '18