gregd99
Posts: 20
Joined: Mon Feb 20, 2012 6:57 am

sbin missing in path

Sun Jun 17, 2012 2:56 am

At the moment I am doing most of my pi experiments using an rdp session as it save setting up another keyboard/mouse/monitor...

I can rdp to the pi. can samba back to my pc drives so all the basics are working.

I have found something, which to me, is a bit strange.

If I login with a keybaord connected to the pi then I am able to use apt-get to install packages. Form the rdp session this fails with a string of messages saying ldconfig not found.

when I look further I see that all of the sbin paths are missing from $PATH.

I suspect that this is a simple problem to solve.... but blowed if I know how.

any hints?

bitplane
Posts: 25
Joined: Sun Jan 08, 2012 6:20 am
Contact: Website

Re: sbin missing in path

Sun Jun 17, 2012 6:19 am

My Pi hasn't arrived yet and I haven't used RDP on Linux, but I'd guess that /etc/environment isn't being executed. Maybe try adding a ". /etc/environment" line to your ~/.bashrc or /etc/profile?

User avatar
jojopi
Posts: 3086
Joined: Tue Oct 11, 2011 8:38 pm

Re: sbin missing in path

Mon Jun 18, 2012 9:58 am

I assume you are using the foundation's recommended debian image.

It is actually normal in standard debian that sbin is not in the path of non-root users, even those with sudo access. The foundation's images have tried to add sbin to path, but it does not work in all session types. The default path for xrdp was built into the package at compile time by debian.

One easy workaround is to use "sudo -i apt-get ...". This sets the environment for the sudo'd command to be more as if you had initially logged in as root. If you want to change PATH permanently you can do it in ~/.bashrc for one user, or /etc/bash.bashrc for all users.

Return to “Beginners”