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

 

 

 

[SOLVED]I am helpless expanding the $PATH variable!?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

[SOLVED]I am helpless expanding the $PATH variable!?

#1 Post by debcub »

Hi,

I am using Debian Buster LXDE. To solve the following problem, I searched this site, Debian Wiki and Google; to no avail. The most I can get is, e.g.,
Probably I am too dumb to unserstand the subject. I would be very grateful if somebody could help.

The problem
*** 1 ***
echo $PATH or "env" tells me for my Debian installation:

Code: Select all

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
My multiboot Lubuntu 18.04 (also LXDE) tells me:

Code: Select all

PATH=/home/<user>/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Now I would like to expand the Debian path to include "/usr/sbin" like in Lubuntu.
And since it is multi-user, this should be done globally.

*** 2***
Are the other subpaths, such as "/usr/local/sbin" etc, only present in Lubuntu but not in Debian, necessary?

*** 3 ***
I woud like to get rid of "/usr/local/games:/usr/games".

Thanks, debcub
Last edited by debcub on 2020-07-16 12:06, edited 1 time in total.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#2 Post by cuckooflew »

First, Why ?
Debian is not ubuntu, lubuntu.....
Are the other subpaths, such as "/usr/local/sbin" etc, only present in Lubuntu but not in Debian, necessary?
I don't know if they are necessary in Lubuntu or not, Debian is Debian, not Lubuntu , if that is the default path/ens setting in lubuntu, maybe it is, on lubuntu. The default paths/env on Debian is the way it is because that is what works on Debian, uunless you have a specific reason you think you need to change it, then it should be left like it is,...What is the reason you want to change it ?
Are you trying to run Ubuntu packages on Debian ? This would be one reason not to try to mix in ubuntu packages, they might not work properly due to the different path/env structure,...I think it would be best if you just tell us why you need to do this.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#3 Post by debcub »

cuckooflew wrote:First, Why ?
Because, if I do <Alt>+<F2> then "gparted /dev/sdb", then nothing happens. E.g. when I want GParted to address only my USB stick, sdb, and not all partitions on my hard drive*, sda, which is very time consuming.

However if I do the same with L/Ubuntu or other major distros, after <Alt>+<F2> then "gparted /dev/sdb", the Authentication menu opens, and only my USB stick is addressed.

To achieve the same with Debian, the Run command is a bit mor complicated: <Alt>+<F2> then "/usr/sbin/gparted /dev/sdb".

Am I too naive to believe, that adding "/usr/sbin" to $PATH would amend this? Anyway, "usr/bin" is in $PATH, why did they leave out "/usr/sbin"?

P.S. *: That happens when I use Main Menu > System Tools > GParted.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#4 Post by cuckooflew »

Does

Code: Select all

export PATH=$PATH:~/usr/sbin 
not work for you ?
Then check using the

Code: Select all

env  
command
The are more details on the wiki, I know you said it does not work, Show us what you actually did, I have to run now, and also maybe wait, someone else with mor experience can give you better details.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#5 Post by debcub »

debcub wrote:
cuckooflew wrote:Am I too naive to believe, that adding "/usr/sbin" to $PATH would amend this?
Yes I was too naive. Because, I managed to have now my wished path in env (which solves my OT question but not my underlying problem):

Code: Select all

$env
...
PATH=/usr/local/bin:/usr/bin:/usr/sbin:/bin
However, after <Alt>+<F2> then "gparted /dev/sdb", still nothing happens. When I do it in terminal, it is fine:

Code: Select all

~$ gparted /dev/sdb
localuser:root being added to access control list
Unit tmp.mount does not exist, proceeding anyway.
======================
libparted : 3.2
======================
Then I input the Admin password and only my USB-stick is addressed by GParted. Terrific!
After I close GParted:

Code: Select all

localuser:root being removed from access control list
~$
What does this mean, "root being added" "root being removed" please? Why does it work in a terminal and not in the Run menu? (I fear to say "and why does it work in other distros?)

EDIT:I would not mind using the terminal for GParted. Is this ok?

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: I am helpless expanding the $PATH variable. Please help!

#6 Post by LE_746F6D617A7A69 »

Wow! Your ability to complicate simple things is simply amazing ... :roll:

Is it really that hard to just click the menu? How often You're re-partitioning the USB drives? Once an hour?

Anyway, stop messing with the PATH settings - this is not needed and dangerous.

All You need is to just put

Code: Select all

/usr/sbin/gparted /dev/sdb
in the shortcut settings ;)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#7 Post by debcub »

LE_746F6D617A7A69 wrote:Wow! Your ability to complicate simple things is simply amazing ... :roll:
I have been using this complicated ;) "gparted /dev/sdb" since decades, having picked it up from the gparted manpage. Of course, "sdb" is just one example, it works with any device, e.g., "gparted /dev/sdb dev/sdc" and I would hate to have a shortcut for each of them. I admit, I should follow your heed and use the much simpler ;) "Main Menu > System Tools > GParted" and be patient.
“Things may come to those who wait...but only the things left from those who hustle!” (Abraham Lincoln).

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 6 times
Been thanked: 16 times

Re: I am helpless expanding the $PATH variable. Please help!

#8 Post by Dai_trying »

The easiest way IMO is to create a symlink in /usr/local/bin (or any folder in your $PATH) to gparted

Code: Select all

ln -s /usr/sbin/gparted /usr/local/bin/gparted
As root or with sudo, then you can access it directly

Code: Select all

gparted /dev/sda
and you are not exposing your system to a multitude of threats by following your Ubuntu habits. :D

debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#9 Post by debcub »

You are a genius, Dai_trying, thank you :D
<Alt><F2> "gparted /dev..." works now like a champion"!
May I ask something else related to this:
What is so bad to have

Code: Select all

PATH=/usr/local/bin:/usr/bin:/usr/sbin:/bin
instead of the original

Code: Select all

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
I don't care for games, and why should sbin not be included in PATH?
Happy, debcub

User avatar
Bloom
df -h | grep > 90TiB
df -h | grep > 90TiB
Posts: 505
Joined: 2017-11-11 12:23
Been thanked: 26 times

Re: I am helpless expanding the $PATH variable. Please help!

#10 Post by Bloom »

Because sbin contains programs and scripts only executable by root. That's why it's not in the PATH of normal users. When you use sudo, sbin will be in the PATH because sudo uses the root PATH variable.

debcub
Posts: 61
Joined: 2017-01-18 16:12
Been thanked: 1 time

Re: I am helpless expanding the $PATH variable. Please help!

#11 Post by debcub »

Thank you, Bloom, I am convinced. I have the original pristine PATH setting again :D
On a side note, I have been using Debian from Etch to Buster, and I am looking forward to Bullseye

Post Reply