I have a few programs (python, bash, etc., some are my own, some are third-party) that I want to be able to use anywhere. Hence, i thought about putting them somewhere in my $PATH. I recently switched from Ubuntu, where it is somewhat standard practice to put these things in /usr/local/bin
. However, now on Manjaro, I get an error message that says Permission denied
. As I understand, the problem is that on Arch-based OS, the directory /usr/local/bin
is also used by the package manager, pacman (I read this somewhere but can't find the source anymore).
In summary, what I need is:
a directory on my $PATH where I can save all these scripts
the possibilty to have version control in that directory
I am aware that I could just make some directory somewhere on my hard drive and add that to my $PATH, but I'm wondering if there is a common practice in place.
EDIT: This is my $PATH variable:
/home/douglas/bin:/home/douglas/bin:/home/douglas/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
Does someone know why /home/douglas/bin
appears twice?
~/bin
and~/.local/bin
are common. You shouldn’t ask two questions but that some directories appear twice means that the file which exportsPATH
got sourced twice. Consider putting environment variables in.profile
not.bashrc
. See also How to correctly add a path to PATH?. – Devon Aug 25 '20 at 17:58