error: XDG_RUNTIME_DIR not set in the environment.

  • 1
  • Problem
  • Updated 3 years ago
Following directions to setup a scheduled reboot in Ubuntu (14.04 latest Chrome)

And I get this error trying to Disable Apport and setup the scheduled reboot.

error: XDG_RUNTIME_DIR not set in the environment.

Anybody else run into this and know a solution?

Photo of KrayMitchell


  • 776 Points 500 badge 2x thumb
  • confused

Posted 3 years ago

  • 1
Photo of Matthew Fisher

Matthew Fisher

  • 1,420 Points 1k badge 2x thumb
Official Response

This is a problem that can occur (sometimes) when elevating privileges and running a GUI application (e.g. gedit).
See here:

They suggest running "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit" instead of "sudo gedit",
but I can't verify that because I'm unable to replicate the problem it is trying to solve.