Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    

    by adding your path to it:

    PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/treedev/lib/Qt/bin"
    

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

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

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

 
discard

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.