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

Kernels & Hardware, configuring network, installing services

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

Postby debcub » 2020-07-15 10:03

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.
debcub
 
Posts: 55
Joined: 2017-01-18 16:12

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

Postby cuckooflew » 2020-07-15 10:42

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!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

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

Postby debcub » 2020-07-15 12:20

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.
debcub
 
Posts: 55
Joined: 2017-01-18 16:12

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

Postby cuckooflew » 2020-07-15 13:51

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!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

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

Postby debcub » 2020-07-15 14:15

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?
debcub
 
Posts: 55
Joined: 2017-01-18 16:12

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

Postby LE_746F6D617A7A69 » 2020-07-15 16:22

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
LE_746F6D617A7A69
 
Posts: 414
Joined: 2020-05-03 14:16

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

Postby debcub » 2020-07-15 18:20

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).
debcub
 
Posts: 55
Joined: 2017-01-18 16:12

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

Postby Dai_trying » 2020-07-15 19:32

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
Dai_trying
 
Posts: 943
Joined: 2016-01-07 12:25

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

Postby debcub » 2020-07-16 07:30

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
debcub
 
Posts: 55
Joined: 2017-01-18 16:12

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

Postby Bloom » 2020-07-16 08:10

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.
User avatar
Bloom
 
Posts: 304
Joined: 2017-11-11 12:23

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

Postby debcub » 2020-07-16 12:00

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
debcub
 
Posts: 55
Joined: 2017-01-18 16:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable