Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It appears that Debian 6.0.2.1 terminal caches path of executables, which is avoiding fresh executables to be run on the same terminal. I would like to know if this is a feature and if so, how to change it.

Here is a sample scenario that I tried. The system had pre-installed python 2.6.6. I opened a new terminal and ran 'python'. Now, I downloaded python 2.7.2, did make install. I validated that the installation was successful and PATH had /usr/local/bin before /usr/bin(where python 2.6.6 resides). Now, when I run 'python', it executes python 2.6.6 always. Sample screen capture:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ which python
/usr/local/bin/python
$ `which python`
Python 2.7.2 (default, Aug  8 2011, 14:21:09) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Now, I open a new terminal and execute python. It behaves correctly and runs the newer 2.7.2 python.

Any suggestion if this 'feature' can be changed to normal working mode?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

After installation it's sometimes necessary to give command hash -r, or in some shells rehash before the new executable paths come valid.

share|improve this answer
    
Thanks, it worked. –  Ethan Collins Aug 8 '11 at 13:10

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.