如何将 /usr/bin/python 指向 python2.6?

如何将 /usr/bin/python 指向 python2.6?

我做过类似的事情:

http://paste.ubuntu.com/704579/

我有点想撤消这一点。

尝试删除 virtualbox-ose 时出现错误提示

Removing virtualbox-ose ...
 * Stopping VirtualBox kernel modules                                    [ OK ] 
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 2300, in <module>
    main()
  File "/usr/bin/pycentral", line 2294, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 1653, in run
    runtimes = get_installed_runtimes(with_unsupported=True)
  File "/usr/bin/pycentral", line 278, in get_installed_runtimes
    default_version = pyversions.default_version(version_only=True)
  File "/usr/share/pycentral-data/pyversions.py", line 172, in default_version
    raise ValueError, "/usr/bin/python does not match the python default version. It must be reset to point to %s" % debian_default
ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.6
dpkg: error processing virtualbox-ose (--remove):
 subprocess installed pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 2300, in <module>
    main()
  File "/usr/bin/pycentral", line 2294, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 1477, in run
    runtimes = get_installed_runtimes()
  File "/usr/bin/pycentral", line 278, in get_installed_runtimes
    default_version = pyversions.default_version(version_only=True)
  File "/usr/share/pycentral-data/pyversions.py", line 172, in default_version
    raise ValueError, "/usr/bin/python does not match the python default version. It must be reset to point to %s" % debian_default
ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.6
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 virtualbox-ose
E: Sub-process /usr/bin/dpkg returned an error code (1)

有一行字是这么说的/usr/bin/python 与 python 默认版本不匹配。必须将其重置为指向 python2.6

所以我的问题是如何让 /usr/bin/python 匹配默认版本 (python2.6)?

答案1

假设您有另一个版本[即 2.7] 并且还安装了 2.6,我会这样做:

ln -sf /usr/bin/python2.6 /usr/bin/python

然后,python 将成为 python2.6 的符号链接

这就是你要问的,对吧?或者我这里漏掉了什么。

相关内容