Server Fault is a question and answer site for system and network administrators. 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 have an older version already installed. I have upraded the package using install command. But the path is not correctly set. When I type "s3cmd" is shows the older version of software.

# s3cmd
s3cmd [options] <command> [arg(s)]              version 1.2.6
  --help    -h        --verbose     -v     --dryrun    -n

# which s3cmd

The correct version is in different folder and I will like that to be used whenever I type the command.

# /usr/bin/s3cmd
Consider using --configure parameter to create one.

How do I set path?

I have added path to .bash_profile file but it does not work.

share|improve this question

closed as not a real question by Ward, EEAA, Michael Hampton, Magellan, rnxrx Oct 14 '12 at 7:03

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Three problems here and one suggestion.

  1. If you write it like that, it sets a local variable named PATH during the execution. What you want to change is the environment variable. To do so, you need the export command. So you need to write export PATH=/some/stuff:/here:instead:..

  2. Additionally, if your system is finding the wrong command first, then you need to reorganize the precedence of PATH so that it finds the right one first. Being the first item in the PATH list is hit first. So, if you add the declaration at the end, you aren't actually tackling the problem. So, you need to write export PATH=/new/path:$PATH.

  3. PATH takes paths, not files. You should be writing /usr/bin, not /usr/bin/s3cmd.

Lastly, my suggestion to you is not to fix your path, but to remove your old s3cmd since you don't seem to use it anymore.

share|improve this answer
Point 2 and 3 worked. The software was not installed using rpm so rpm -e is not working to remove the old version. – shantanuo Oct 14 '12 at 5:41

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