-bash: /usr/bin/yum: /usr/bin/python: bad interpre

2020-02-15 15:44发布

问题:

root@host [~]# yum

-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

None- Actually, I deleted old python2.6 directory and install new python2.7 in linux redhat 4.4.7 OS.

回答1:

Don't modify the system python; too many things rely on it (like your package manager!). If you want to install a different version of Python, install it somewhere else (/usr/local, your home directory, etc).

If you actually deleted the python2.6 directorY (e.g., /usr/lib/python2.6), you haven't just deleted python 2.6 -- you have deleted any additional python modules that were installed on your system, potentially breaking all sorts of things. There's not really a good way to recover from this situation.

If you were to restore the /usr/lib/python2.6 directory from another system you would at least be able to run yum again, although your system would still be fundamentally broken. Your best bet is to reinstall from scratch.

If you only deleted the python2.6 binary and left the library directory intact, you could simply restore /usr/bin/python2.6 and things would be relatively back to normal.



标签: linux redhat