-2

I have an older version already installed. I have upraded the package using setup.py 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
/usr/local/bin/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.

PATH=$PATH:/usr/bin/s3cmd
shantanuo
  • 3,579
  • 8
  • 49
  • 66

1 Answers1

1

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.

Grumpy
  • 2,979
  • 18
  • 23
  • 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 05:41