Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-27-2006, 01:13 PM   #1
Registered: Apr 2004
Posts: 38

Rep: Reputation: 15
setting environment variables

I working with Fedora Core 5 and I am trying to install QT.
I have done the installation and the next step is to update my environement variable.

I am using bash.

I looked at the online documentation and they said I need to add to my .profile the following:

export PATH

I did so by adding it to different places:
1. /etc/profile
2. ~/.bashrc
3. /etc/bash

when I type set, my PATH doesn't append the new string.

What should I do? I am doing exactly as I am reading and it is not working!

Old 06-27-2006, 01:20 PM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
After you've edited your .bash_profile or .profile, you need to use source, e.g. "source .bash_profile". Either file should be in your home directory, if not there you can create them. If you run set after that, you should see the changes.

Edit: see this post for a reason you should add it to .bash_profile instead of .bashrc.

Last edited by Nylex; 06-27-2006 at 02:09 PM.
Old 06-27-2006, 01:25 PM   #3
Registered: Oct 2005
Location: Bhopal, India
Distribution: RHEL 6
Posts: 422

Rep: Reputation: 30
Simple add this line at the end of /etc/profile and relogin (Sometimes reboot might be required)
export PATH=$PATH:/usr/local/Trolltech/Qt-4.1.4/bin
It should work.
Old 06-27-2006, 02:03 PM   #4
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
If you use source, you don't have to reboot or login again..
Old 06-27-2006, 02:36 PM   #5
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
The changed path will exist in the shell where you sourced your profile, or ran "bash -l", however it won't change for other shells, such as when you click on an icon for a qt program. You need to log out and log in again to do that.
Old 06-27-2006, 03:15 PM   #6
Registered: Apr 2004
Posts: 38

Original Poster
Rep: Reputation: 15
it works

Thanks! The "source" fixed it.

THanks again!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variables setting... simjii SUSE / openSUSE 4 11-19-2005 07:50 PM
Setting Environment Variables rbh123 Linux - Newbie 2 10-03-2005 06:34 PM
setting environment variables jayjoh Linux - Newbie 9 07-12-2004 12:35 PM
setting environment variables durden2.0 Linux - Newbie 5 07-15-2003 01:57 PM
setting environment variables rezza Linux - Distributions 2 04-09-2003 08:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration