I used to open up text documents with sublime, and also for Read-only files, I provided to perform :sudo sublime. Yet now just suddenly the sudo sublime command gives the following error :

(sublime:3931): Gtk-WARNING **: cannot open display:while sublime command is working fine. I tried the exact same with gedit, and also the very same thing happened, with the error through gedit being presented :

error: XDG_RUNTIME_DIR not collection in the environment.(gedit:3933): Gtk-WARNING **: cannot open display: I set up gtk, and tried gksudo, still got the same error!

I searched the web and found these methods :

export DISPLAY=:0.0 : ssh username
hostname -Y

None the the over worked.

You are watching: Error: xdg_runtime_dir not set in the environment.

What worked out for me to be :

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sublimeFrom here : https://askubuntu.com/questions/456689/error-xdg-runtime-dir-not-set-in-the-environment-when-attempting-to-run-naut

I want to recognize why specifically am I gaining this error, that also suddenly! Also, I want to get earlier to the sudo sublime version, since it is straightforward to remember. How deserve to I resolve that?

Also, the recent transforms I did come the mechanism were :

Installed gksu(for gksudo)

Help would certainly be very appreciated!



I have the exact same problem.

The reason in my situation is the sudo does no inherit atmosphere variables: display XAUTHORITY.

HOW come FIX?

For Ubuntu 14, open up sudoers record via sudo visudo, climate paste:

Defaults env_keep += "DISPLAY XAUTHORITY"


Had very same problem. My fault that ns followed one more answer and also changed file sudoers with next string:

Defaults env_keep="https_proxy"But i should have added that:

Defaults env_keep += "https_proxy"First wire overrides present list.


I also had the same trouble on Ubuntu 14.04. It was led to while following another answer.Open terminal by pressing,

Ctrl+ Alt + T

then $ sudo visudo


Defaults env_keep="https_proxy"to

Defaults env_keep += "https_proxy"It worked for me.


If you see XDG_RUNTIME_DIR in the calculation of env as a continuous user, then every you probably need to perform is usage the -E switch to keep the environment.

Thanks for contributing response to ridge Overflow!

Please be certain to answer the question. Carry out details and share her research!

But avoid

Asking because that help, clarification, or responding to various other answers.Making statements based upon opinion; ago them up with references or personal experience.

See more: How To Disconnect Ac Lines On Dodge Ram, Ac & Fuel Line Disconnect

To find out more, see our advice on writing an excellent answers.

article Your prize Discard

By click “Post her Answer”, you agree to our regards to service, privacy policy and also cookie policy

Not the price you're looking for? Browse various other questions tagged ssh gtk ubuntu-14.04 sudo xdgutils or ask your very own question.

Errors "QStandardPaths: XDG_RUNTIME_DIR no set, defaulting to '/tmp/runtime-mizu'" once running phantomjs from contab
(Linux) exactly how to run a regime of gtk without screen environment? Gtk-WARNING **: cannot open display:
site style / logo design © 2021 ridge Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.9.27.40313

your privacy

By clicking “Accept every cookies”, girlfriend agree stack Exchange deserve to store cookie on your device and disclose information in accordance through our Cookie Policy.