I am using Ubuntu 16.04 and I want to change the PATH variable. I know that I can do this by adding export PATH=/home/patrick/.npm/bin:$PATH to for example ~/.profile. Now if I do this and then use source ~/.profile everything is fine and echo $PATH gives me the PATH variable with my change. But if I restart Ubuntu ~/.profile apparently doesn't get sourced and I am left with just the basic PATH set in /etc/environment.
I also tried using one of the other configuration files, namely /etc/profile, /etc/environment and ~/pam_environment with the same results. What is even more strange is that my ~/.profile file now has this content:
export HP_HOME=/home/patrick/git/www/p8.de/predic8.de
export PATH=/home/patrick/.npm/bin:$PATH
export PATH=/home/patrick/.npm-global/bin:$PATH
export PATH=/home/patrick/.config/composer/vendor/bin:$PATH
export PATH=/usr/local/bin/composer:$PATH
export PATH=/home/patrick/.local/share/umake/bin:$PATH
and HP_HOME gets set succesfully after each reboot. What am I missing here?
Put it at the end of your ~/.bashrc.
you can add your path on /etc/environment
for the example inside this file can seen like this
PATH="/usr/local/sbin"
and you can add new path like this
PATH="/usr/local/sbin:/myhomefolder/mygame"
don't forget to add : for the separator
and restart your computer
and this is permanent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With