如何选择 Python 版本在 Gentoo 中安装

Sha*_*nu4 3 linux package-management python gentoo

我正在使用 Gentoo Linux 并且我想安装 Python2.5 但有一个问题。

该命令emerge -av python输出以下内容,

    These are the packages that would be merged, in order:

    Calculating dependencies... done!
    [ebuild     U ] dev-lang/python-3.1.2-r3 [3.1.1-r1] USE="gdbm ipv6 ncurses readline ssl threads (wide-unicode%*) xml -build -doc -examples -sqlite* -tk -wininst (-ucs2%)" 9,558 kB
    [ebuild     U ] app-admin/python-updater-0.8 [0.7] 8 kB
Run Code Online (Sandbox Code Playgroud)

还有更多版本的 ebuild:

    # ls /usr/portage/dev-lang/python
    ChangeLog  
    files  
    Manifest  
    metadata.xml  
    python-2.4.6.ebuild  
    python-2.5.4-r4.ebuild  
    python-2.6.4-r1.ebuild  
    python-2.6.5-r2.ebuild  
    python-3.1.2-r3.ebuild
Run Code Online (Sandbox Code Playgroud)

如何选择我想要的ebuild?(python-2.5.4-r4)

更新

@Ophidianemerge -av =python-2.5.4-r4工作..谢谢

小智 6

实际上,您不需要指定完整版本。更合适的方式是

emerge -av python:2.5


Oph*_*ian 5

我相信 Python 是有槽的,所以你应该能够让多个版本共存而不会出现问题。

你可以简单地通过指定你想要的版本来出现一个特定的版本:

emerge -av =python-2.5.4-r4
Run Code Online (Sandbox Code Playgroud)

或使用较新的 portage 版本,按插槽名称而不是版本 #:

emerge -av python:2.5
Run Code Online (Sandbox Code Playgroud)

您可能会发现一些有用的链接: