Coder Perfect

Permanently modify the PATH on Ubuntu [closed]

Problem

For the Play! framework installation, I’d like to add the value “:/home/me/play/” to PATH. As a result, I executed the following command:

PATH=$PATH:/home/me/play

It was successful. However, the following time I checked, the value had reverted to the previous one.

So it’s safe to assume I didn’t “store” the updated value?

How do you go about doing that?

Asked by socksocket

Solution #1

Add

export PATH=$PATH:/home/me/play

Add your /.profile file and run it

source ~/.profile 

in order for changes to your current terminal instance to be reflected quickly.

Answered by lollo

Solution #2

Using vi /.profile, add the following line to your.profile file in your home directory:

PATH=$PATH:/home/me/play
export PATH

Then, to make the change take effect, write the following into your terminal:

$ . ~/.profile

Answered by ndeverge

Solution #3

In the /.bashrc file, try adding export PATH=$PATH:/home/me/play.

Answered by Danil Speransky

Solution #4

Add the following line to your /etc/profile.d/play.sh (and maybe play.csh, etc) if you want this path to be available to all users on the system:

PATH=$PATH:/home/me/play
export PATH

Answered by Brian Cain

Post is based on https://stackoverflow.com/questions/11709374/change-path-permanently-on-ubuntu