Ask Your Question

Why do I get an error launching Gedit with sudo in Fedora 25?

asked 2016-12-05 02:24:22 -0500

graceful gravatar image

updated 2016-12-18 17:48:55 -0500

mattdm gravatar image

Every time I launch gedit with sudo, I get the following error:

[xxxxxx@localhost ~]$ sudo gedit /etc/default/grub [sudo] password for xxxxxx: No protocol specified Unable to init server: Could not connect: Connection refused

(gedit:2412): Gtk-WARNING **: cannot open display: :0 [sophie@localhost ~]$ ud

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2016-12-05 12:22:42 -0500

Period22 gravatar image

updated 2016-12-18 17:51:06 -0500

mattdm gravatar image

Security features in wayland prevent running whole applications as root in this way. However, you can edit files with sudo-like privileges like in this example:

gedit admin:///etc/default/grub

which then asks for authentication.

edit flag offensive delete link more


leads to another question! Does WAYLAND (Display Server Protocol) not support legacy graphics inbuilt in older motherboards? My computer's hardware(Intel motherboard) details show 'unknown' against graphics heading.

behari72 gravatar imagebehari72 ( 2016-12-27 07:58:27 -0500 )edit

answered 2016-12-05 03:38:59 -0500

geforce gravatar image

Another gnome wayland regression/feature

edit flag offensive delete link more

answered 2016-12-06 00:13:15 -0500

graceful gravatar image


Apparently, the Wayland stupidity-policy er I mean security-policy won't allow any gui application to have root privileges. I did however find a work around by logging in as root first with 'su', then launching gedit. However, since I use other gui launched apps that need root privileges, such as grub-customizer and I need desktop icons as part of my workflow, I gave-up on Wayland and dropped back to X.

The above bug report suggested the following:

John Dulaney 2015-10-30 11:31:38 EDT

Policy decisions aside, if the decision to go with letting gui applications have root access is made, then I think that the fix should be made in libwayland itself, and not left up to the individual compositors. It seems that this would be something you would want to have across the board, no matter if you're running Gnome, Weston, or (like I am), a tiling compositor that isn't in Fedora (yet).

I think this is the sano fix since it solves the problem at a common bottleneck, instead of creating two problems that have to be solved seperately. BTW, I come from a Windows background. Good luck getting me to learn VIM or NANO.

edit flag offensive delete link more

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: 2016-12-05 02:24:22 -0500

Seen: 11,077 times

Last updated: Dec 18 '16