I just upgraded to bookworm. I noticed that /bin is a symbolic link to /usr/bin and /sbin is a symbolic link to /usr/sbin. Is there a reason that the normal user $PATH does not have /sbin in it? Also noticed that the normal user $PATH has /usr/bin and /bin isn't the redundant?
I was looking into this because several times I would try to run a program and would get the message command not found.
PS when does .profile in the user home directory get called. I made a change to the $PATH. But when I open a new konsole it does not get the change.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Software] DEbian 12.5 $PATH
- sunrat
- Administrator
- Posts: 6513
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 119 times
- Been thanked: 489 times
Re: [Software] DEbian 12.5 $PATH
Standard users are not supposed to be allowed to run commands in /usr/sbin/. The recommended way to do so is escalate privileges with su - (note the dash) or with sudo.
Adding path in .profile should work but you would need to log out then back in before it works. It's a dirty hack though.
Adding path in .profile should work but you would need to log out then back in before it works. It's a dirty hack though.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: [Software] DEbian 12.5 $PATH
Thanks for your response. I've been using Linux for years. I was on stretch on my desktop and Wheezy on my WD My Clouds and even a later versiopn on the DLink-323. In all that time I've never had the problem of programs not found after doing an su. I know that normal users should not run programs in /sbin or /usr/sbin. But after installing debian bookworm. I was constantly having commands not found. While trying to setup the bookworm. I had to google the error I received. But the information that I found mostly failed with command not found.
After getting your response. I see that my problem was not using the dash with the su command. For the last 20 years or more su worked. Thats why I thought I had to add sbin to the $PATH. I checked the $PATH after both su and su - and found why my command didn't work.
It's difficult working on Bookworn when a lot of what I used to do failed and I have no one to ask. I just found the forum.
PS still don't undersatnd why /bin and /usr/bin is in my $PATH.
After getting your response. I see that my problem was not using the dash with the su command. For the last 20 years or more su worked. Thats why I thought I had to add sbin to the $PATH. I checked the $PATH after both su and su - and found why my command didn't work.
It's difficult working on Bookworn when a lot of what I used to do failed and I have no one to ask. I just found the forum.
PS still don't undersatnd why /bin and /usr/bin is in my $PATH.
-
- Posts: 306
- Joined: 2015-06-07 14:38
- Has thanked: 11 times
- Been thanked: 35 times
Re: [Software] DEbian 12.5 $PATH
While it may not be advisable I just create a PATH in my /etc/environment file
This eliminates the entire issue. But it's not the proper way to go so do it at your own risk.
Code: Select all
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- sunrat
- Administrator
- Posts: 6513
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 119 times
- Been thanked: 489 times
Re: [Software] DEbian 12.5 $PATH
The $PATH was changed for Jessie IIRC. something something security...
Most of the commands you run as user will be in /usr/bin/ so it must be in user $PATH.
Most of the commands you run as user will be in /usr/bin/ so it must be in user $PATH.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: [Software] DEbian 12.5 $PATH
Thanks again. My question was not why is /usr/bin in the path bu why is /bin? Since /bin/is a symboliclink to /usr/bin. When a comand does not exist /usr/bin/will be searched then /bin will be searched.
- sunrat
- Administrator
- Posts: 6513
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 119 times
- Been thanked: 489 times
Re: [Software] DEbian 12.5 $PATH
I guess it's redundant but remains for compatibility with older Debian versions when upgraded. usrmerge happened a couple of releases ago - https://wiki.debian.org/UsrMerge
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!