You are not logged in.

#1 2017-01-07 10:55:55

ArcoFreccia
Member
Registered: 2016-10-11
Posts: 23

Unable to run program as administrator

I'm unable to run application from terminal as administrator. For example if i run:

 sudo gparted 

but also if i run the same program via

 su 

the program won't start and the error is this:

 Created symlink /run/systemd/system/-.mount → /dev/null.
Created symlink /run/systemd/system/run-user-1000.mount → /dev/null.
Created symlink /run/systemd/system/run-user-120.mount → /dev/null.
Created symlink /run/systemd/system/tmp.mount → /dev/null.
Created symlink /run/systemd/system/var-lib-machines.mount → /dev/null.
No protocol specified

(gpartedbin:1076): Gtk-WARNING **: cannot open display: :0
Removed /run/systemd/system/-.mount.
Removed /run/systemd/system/run-user-1000.mount.
Removed /run/systemd/system/run-user-120.mount.
Removed /run/systemd/system/tmp.mount.
Removed /run/systemd/system/var-lib-machines.mount. 

Not all the programs do this problem, "vim" or "nano" works, but they have no GUI and the error is something about Gtk...someone can help me? Thx!

Offline

#2 2017-01-07 11:06:07

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Unable to run program as administrator

Are you trying to run graphical applications from a text terminal? The error message says that it cannot open a display, which usually either happens if no display is running (you're in a text terminal) or you are running the commands remotely and have either forgotten to forward X via ssh or your DISPLAY environment variable is stale (i.e. the value on the remote shell is no longer correct, which may happen when re-attaching a tmux session).

It would help if you could provide some more information on what you're actually trying to do. Are you trying to partition disks from the live CD?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2017-01-07 11:20:53

ArcoFreccia
Member
Registered: 2016-10-11
Posts: 23

Re: Unable to run program as administrator

i'm running terminal from arch installed on ssd (no live CD), then from termial i'm trying to lounch some applications with "sudo" but i can't because the error appear. I could try to reinstall X but if there are some problem with X why gnome start fine when the system starts?

It seems that everything run fine when i lounch command from user account, but from root the monitor disappear. When i lounch for example "gedit", without "sudo" (user account) it starts, but with sudo it gives me the error!

Last edited by ArcoFreccia (2017-01-07 11:29:50)

Offline

#4 2017-01-07 11:27:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,678

Re: Unable to run program as administrator

You are probably in the Wayland session, switch that to GNOME on Xorg in GDM or wherever. That said, never use sudo nor su to start graphical applications. Always use gksudo instead.

Offline

#5 2017-01-07 11:46:49

seth
Member
Registered: 2012-09-03
Posts: 51,071

Re: Unable to run program as administrator

please use gksu, naive sudo won't work for some information needs to be carried to the other user.
Notice that as V1del suggested, even gksu won't work on gnome on wayland atm, so ensure to use gnome on Xorg.

And on a sidenote: avoid running especially graphical clients as root - it should not be required (while it seems gparted's polkit support is running gparted with pkexec ...)

Online

#6 2017-01-07 12:41:35

ArcoFreccia
Member
Registered: 2016-10-11
Posts: 23

Re: Unable to run program as administrator

thanks, i was in wayland...my error, now in Xorg all work fine!

Offline

Board footer

Powered by FluxBB