2

I have a battery power issue that I'm trying to resolve. One proposed solution involves adding some boot arguments and then removing the battery, but I'm running into trouble on the first step. To add a boot argument, I'm running

gksudo gedit etc/default/grub

However, I get this response:

Error copying '/home/username/.Xauthority' to /tmp/libgksu-0n0AJS': No such file or directory

New to Ubuntu and not an advanced user.

Zanna
  • 70,465
Cruiser13
  • 145
  • 3
    gksudo gedit etc/default/grub the command should be gksudo gedit /etc/default/grub. ""Error copying '/home/username/.Xautority' to /tmp/libgksu-0n0AJS': No such file or directory" please don't retype error messages; copy/paste the actual message .Xautority is not the name it stated: it is at least missing an "h". – Rinzwind Feb 04 '18 at 16:50

1 Answers1

3

You've hit an unfortunate snag, see eg https://askubuntu.com/a/961975/29073. The problem is probably you're using Wayland, and the default permissions aren't set for you to open up a GUI window from the commandline.

I'd skip the GUI method, open a terminal, eg gnome-terminal (I use kubuntu and actually use yakuake) and do

sudo nano /etc/default/grub

Edit as appropriate, save (ctrl+x, choose yes), then don't forget to

sudo update-grub

If you need to use gedit then you can allow root, and any local user, to create windows on your display by doing xhost +local: before issuing the gksudo command.

pbhj
  • 3,231
  • Or you can use sudo -E gedit /etc/default/grub. – psusi Feb 04 '18 at 20:11
  • @psusi does that bypass this problem with Wayland? – Zanna Feb 04 '18 at 21:28
  • FWIW @psusi that doesn't work for me on Kubuntu with kate but gives an error and says you have to set the editor as the sudoedit program and use sudoedit. If it works for you - I don't have a standard Gnome based install - then it would be useful as an answer. – pbhj Feb 04 '18 at 22:04
  • 1
    I'm not sure if kate is a native wayland app or not... if it isn't, then it won't work since Xwayland is misconfigured and breaks root X11 applications running under wayland. gedit functions as a native wayland application so it works as long as you have sudo preserve the environment ( the -E switch ). – psusi Feb 04 '18 at 23:22