Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Lubuntu 12.04.

I am having problems setting the path variable for my application.

I am trying to set the path variable in the .profile file, however after adding the path when I echo $PATH, it does not show my addition.

Here is the line I am adding at the end of the .profile after the 'fi'

export PATH=$PATH:/home/treedev/lib/Qt/bin

Please let me know what I am doing wrong. When I run the above command directly in the bash shell, it works, which leads me to believe I am doing something wrong, but I can't seem to figure out where I am wrong.

Thanks for your time.

share|improve this question
up vote 1 down vote accepted

To add a system-wide path, simply add to the PATH variable defined in /etc/environment.

  1. Press Alt+F2 and type gksudo gedit /etc/environment
  2. Change the default path:


    by adding your path to it:


To add this path only to your session (i.e. for your user only), add to ~/.pam_environment instead:


Related: Please see the Ubuntu Wiki on Environment Variables.

share|improve this answer
thank you sir for the good answer – Edwin Jul 15 '12 at 4:26

type the command below to load the path

source ~/.profile

Next time onward when the when the user log in it will auto load the path. But I would recommend you the add the path to /etc/profile.

share|improve this answer
thanks for your solution as well :) – Edwin Jul 15 '12 at 4:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.