/usr/sbin not in $PATH causing problems
by mark_alfred from LinuxQuestions.org on (#5AP8B)
I'm finding this so annoying. Apparently the command "su" is no longer to be used, but rather "su -", to access root. And that is fine, yet this change is causing problems. I gathered that bit information from this bug report, which states,
Quote:
Which is fine except it makes it difficult to run things. I installed gufw (firewall program) and it's not working properly. Synaptic is difficult to start:
Code:mark@debian:~$ su -
Password:
root@debian:~# synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:~#Without "Wayland"? What does that even mean? [edit] I did look this up, and apparently it has something to do with the "gnome-shell". But, I never installed gnome, and run things via "startx". Regardless I tried the following command to be sure:
Code:mark@debian:~$ killall gnome-shell
gnome-shell: no process found
mark@debian:~$ su -
Password:
root@debian:~# killall gnome-shell
gnome-shell: no process found
root@debian:~#
root@debian:~# exit
logout
mark@debian:~$ su
Password:
root@debian:/home/mark# killall gnome-shell
gnome-shell: no process found
root@debian:/home/mark#Anyway, the main thing I notice is that neither /sbin nor /usr/sbin are in the $PATH, which has presented challenges running programs that are located there. Synaptic is one such program, though I notice that a file named "synaptic-pkexec" does reside in /usr/bin. But I get the same result when I try to run this. I note it stated, "or run Synaptic without root permission. So, I tried that, with the following result:
Code:mark@debian:~$ synaptic
bash: synaptic: command not found
mark@debian:~$ synaptic-pkexec
==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ===
Authentication is required to run the Synaptic Package Manager
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
mark@debian:~$So, I tried a variety of ways to start Synaptic, and finally was able to... observe:
Code:mark@debian:~$ su -
Password:
root@debian:~# /usr/sbin/synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:~# cd /usr/sbin
root@debian:/usr/sbin# ./synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:/usr/sbin# exit
logout
mark@debian:~$ su
Password:
root@debian:/home/mark# /usr/sbin/synapticSo, that last one worked, using the supposedly incorrect "su" rather than "su -". But I notice other programs, like ufw (gufw), as I mentioned before, don't work. [edit] And apparently the synaptic stuff is a bug from years back. Yeesh.
If anyone has any insights about fixing this, do share.
I'm running Debian 10 on a MacBook Pro laptop (5.5, from like 2010, with 4 GB RAM), using IceWM. I access IceWM via "startx", rather than a display manager.


Quote:
While I no longer maintain util-linux I'm directly responsible for making the change. This change is intentional and aligns su with its documented behaviour. I would also like to stress that using plain 'su' is DANGEROUS because it means you're running a shell as root with the environment inherited from another user. [..] I've already tagged this bug report 'wontfix' and hope the above explanation is clear enough as to why I'm closing this bug report. Regards, Andreas Henriksson |
Which is fine except it makes it difficult to run things. I installed gufw (firewall program) and it's not working properly. Synaptic is difficult to start:
Code:mark@debian:~$ su -
Password:
root@debian:~# synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:~#Without "Wayland"? What does that even mean? [edit] I did look this up, and apparently it has something to do with the "gnome-shell". But, I never installed gnome, and run things via "startx". Regardless I tried the following command to be sure:
Code:mark@debian:~$ killall gnome-shell
gnome-shell: no process found
mark@debian:~$ su -
Password:
root@debian:~# killall gnome-shell
gnome-shell: no process found
root@debian:~#
root@debian:~# exit
logout
mark@debian:~$ su
Password:
root@debian:/home/mark# killall gnome-shell
gnome-shell: no process found
root@debian:/home/mark#Anyway, the main thing I notice is that neither /sbin nor /usr/sbin are in the $PATH, which has presented challenges running programs that are located there. Synaptic is one such program, though I notice that a file named "synaptic-pkexec" does reside in /usr/bin. But I get the same result when I try to run this. I note it stated, "or run Synaptic without root permission. So, I tried that, with the following result:
Code:mark@debian:~$ synaptic
bash: synaptic: command not found
mark@debian:~$ synaptic-pkexec
==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ===
Authentication is required to run the Synaptic Package Manager
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
mark@debian:~$So, I tried a variety of ways to start Synaptic, and finally was able to... observe:
Code:mark@debian:~$ su -
Password:
root@debian:~# /usr/sbin/synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:~# cd /usr/sbin
root@debian:/usr/sbin# ./synaptic
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:/usr/sbin# exit
logout
mark@debian:~$ su
Password:
root@debian:/home/mark# /usr/sbin/synapticSo, that last one worked, using the supposedly incorrect "su" rather than "su -". But I notice other programs, like ufw (gufw), as I mentioned before, don't work. [edit] And apparently the synaptic stuff is a bug from years back. Yeesh.
If anyone has any insights about fixing this, do share.
I'm running Debian 10 on a MacBook Pro laptop (5.5, from like 2010, with 4 GB RAM), using IceWM. I access IceWM via "startx", rather than a display manager.