You are not logged in.

#1 2021-10-07 12:53:29

whynotarch
Member
Registered: 2021-10-07
Posts: 7

cant set PATH

I am trying to install https://github.com/lawl/NoiseTorch and trying to set path via
if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi
it sets the path but when I logout and login it is gone.

Offline

#2 2021-10-07 13:05:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: cant set PATH

You are trying that where and what are you using for login in?

But instead of doing that, why aren't you just using https://aur.archlinux.org/packages/noisetorch instead so you can have pacman keep track of the package? See https://wiki.archlinux.org/title/Arch_User_Repository for how to make use of the AUR

Offline

#3 2021-10-07 13:40:39

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

the ARU package worked thanks.
if someone knows why I can set paths permanently, let me know read the wiki but dont know what I am doing wrong

Offline

#4 2021-10-07 13:43:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: cant set PATH

Which wiki page did you read?  First, there is no reason for the conditional test - its your system, you know the path is there (or you shouldn't be trying to set it in the first place).  But the real problem is you were likely just running that command in an interactive shell rather than putting it in the relevant startup file (e.g., shell profile) as instructed in the relevant wiki page(s).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2021-10-07 13:56:50

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

https://wiki.archlinux.org/title/Environment_variables and export PATH="$HOME/.local/bin:$PATH
this didnt work for me

Offline

#6 2021-10-07 14:00:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: cant set PATH

And where did you put that command?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2021-10-07 14:22:23

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

in the terminal

Offline

#8 2021-10-07 14:29:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: cant set PATH

Which will not persist across relogins, which is why both the installation instructions of the noisetorch package and the environment variables wiki article list files that are intended to contain that information if it should be persisting.

Offline

#9 2021-10-07 15:53:56

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

export PATH="${PATH}:/home/myuser/.local/bin" I have put this in  ~/.bash_profile tried different thing. Explain this to me as if I am 6. BTW I have login and out more than 10 time.

Offline

#10 2021-10-07 16:14:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: cant set PATH

You log in "how"? .bash_profile is only read if bash is your log-in shell which is by default only the case if you actually boot to a terminal and log in there. If you want this in a more global manner that most display managers will honor as well you should use a more global file, like /etc/profile or so

Offline

#11 2021-10-07 16:44:52

dogknowsnx
Guest

Re: cant set PATH

Remove brackets and quotation marks:

export PATH=$PATH:/home/myuser/.local/bin/

Last edited by dogknowsnx (2021-10-07 16:45:21)

#12 2021-10-07 17:10:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: cant set PATH

No, brackets and quotes are harmless, and in some cases the quotes could be necessary.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2021-10-07 17:19:58

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

export PATH="$PATH:/home/myuser/.local/bin"

put in ~/.bash_profile works when I

source ~/.bash_profile

but when I login and out. The  local "PATH" is removed.

Offline

#14 2021-10-07 17:20:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: cant set PATH

V1del wrote:

You log in "how"? .bash_profile is only read if bash is your log-in shell which is by default only the case if you actually boot to a terminal and log in there. If you want this in a more global manner that most display managers will honor as well you should use a more global file, like /etc/profile or so


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#15 2021-10-07 17:28:15

whynotarch
Member
Registered: 2021-10-07
Posts: 7

Re: cant set PATH

I have a standard KDE setup with zsh as the shell, I changed it to bash and everything works. Thanks for the help everyone

Offline

#16 2021-10-07 17:35:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: cant set PATH

... what did you think the name bash_profile meant? You can continue to use zsh but you'd use .zsh_profile instead. Or - more shell-agnostic - most will read a plain .profile as well.

Please mark as [SOLVED] by editing the title in the first post.

Offline

#17 2021-10-07 22:21:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: cant set PATH

So you read the wiki page which told you all about the command to use and where to put it, yet you used a completely different command and didn't know where to put it.  You were directed to read the article again to see where to put it, but you missed that the article explicitly talks about if you use zsh rather than bash, but you still just put the command in your bash_profile.

All the information is quite clearly and explicitly laid out in the wiki page you claimed to have read, yet somehow you missed *all* of it.  If following such written instructions is not practical for you, then you should reconsider the distro you have selected.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB