在RHEL8.3系统上,我安装了两个python3版本,当我列出互斥者的版本时,它们会显示为版本:
$ alternatives --display python3
/usr/bin/python3.6 - priority 1000000
slave easy_install-3: /usr/bin/easy_install-3.6
slave pip-3: /usr/bin/pip-3.6
slave pip3: /usr/bin/pip3.6
slave pydoc-3: /usr/bin/pydoc3.6
slave pydoc3: /usr/bin/pydoc3.6
slave pyvenv-3: /usr/bin/pyvenv-3.6
slave python3-man: /usr/share/man/man1/python3.6.1.gz
/usr/bin/python3.9 - priority 3900
slave easy_install-3: /usr/bin/easy_install-3.9
slave pip-3: /usr/bin/pip-3.9
slave pip3: /usr/bin/pip3.9
slave pydoc-3: /usr/bin/pydoc3.9
slave pydoc3: /usr/bin/pydoc3.9
slave pyvenv-3: (null)
slave python3-man: /usr/share/man/man1/python3.9.1.gz
Current `best' version is /usr/bin/python3.6.
如何使用alternatives
命令选择已经列出的python3.9
作为已使用的版本?(也就是说,当我在命令行python3.9
上输入时,我希望在系统范围内执行python3
)。
注意:我知道我可以在alternatives --install
中添加一个新版本(然后使它成为具有高优先级的最佳版本),但我如何选择已经列出的版本作为最佳版本(并已使用)?
发布于 2021-12-03 15:30:52
alternatives --config python3
将显示已安装的python3
版本列表,您可以选择使用哪个版本。请注意,这将锁定您选择的内容。系统不会自动使用新的更高版本。
alternatives --auto python3
将重置--config
,以便系统在安装新版本时自动使用它认为最好的版本。
https://unix.stackexchange.com/questions/679834
复制相似问题