Ask Your Question
0

Unable to init server

asked 2018-05-26 15:31:37 -0500

ma1bolg3s gravatar image

updated 2018-05-26 15:42:03 -0500

Can anyone tell me how to solve this?

[user1234@localhost ~]$ sudo gedit /etc/sysctl.d/99-sysctl.conf

[sudo] password for user1234: No protocol specified

Unable to init server: Could not connect: Connection refused

(gedit:3486): Gtk-WARNING **: 22:24:00.268: cannot open display: :0

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-05-26 15:54:17 -0500

muep gravatar image

Normally in Fedora, only applications run by your own account can connect into your display server. There are other workarounds, but you can also do this so that gedit runs as your user by using sudo -e like this:

env EDITOR=gedit sudo -e /etc/sysctl.d/99-sysctl.conf

Or if a bit simpler syntax is preferred, you could separately set your editor variable:

export EDITOR=gedit
sudo -e /etc/sysctl.d/99-sysctl.conf
edit flag offensive delete link more

Comments

and then happens this... sudo: /etc/sysctl.d/99-sysctl.conf: editing symbolic links is not permitted

ma1bolg3s gravatar imagema1bolg3s ( 2018-05-26 16:02:06 -0500 )edit
1

Use it like this

env EDITOR=gedit sudo -e /etc/sysctl.conf
aeperezt gravatar imageaeperezt ( 2018-05-26 16:30:59 -0500 )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

Stats

Asked: 2018-05-26 15:31:37 -0500

Seen: 723 times

Last updated: May 26 '18