1

I have remote account of a super computer. I have to install a software CMUSphinx, Which requires swig 2.0+ version as dependency. But Server have version 1.3.40 installed.

Now I can not update it because I am not root user, so I installed swig 3.0.12 in my local account under the path $HOME/local/swig It was installed properly.

But after installation I checked the version and it still says 1.3.40.

So I suppose there must be some path or anything which I need to update but I dont know what exactly I need to change. As I am new to Unix.

enter image description here

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
Adnan Ali
  • 131
  • 1
  • 5
  • In the the answers and comments to [your other question](https://unix.stackexchange.com/questions/360368/installing-software-without-root-user-access) it was already written that you need to update your `PATH` variable. Better read that or your next problem will be with shared library versions, because you didn't set the LD_LIBRARY_PATH – Philippos Apr 21 '17 at 10:55
  • @Philippos that was updated later. but still I think that is not what I am looking for. That answer focus on setting user sessions but I want to add path and dont know where to and how to add. – Adnan Ali Apr 21 '17 at 16:24

1 Answers1

2

When you type swig on the command line, the shell will search for that command in the directories listed in the $PATH variable. It will use the first match that it finds.

Since the swig that you installed (most likely) lives in $HOME/local/swig/bin and since this directory is either not in your $PATH or too late in the it, it picks up the older version of the command.

Put $HOME/local/swig/bin early in your path (verify that this is the correct directory first):

PATH="$HOME/local/swig/bin:$PATH"

See also How do I set a user environment variable? (permanently, not session)

Alternatively, run swig with the path specified:

$ ~/local/swig/bin/swig

Or, if you are in your home directory:

$ local/swig/bin/swig
Kusalananda
  • 320,670
  • 36
  • 633
  • 936