如何selectpython版本在gentoo中安装

我使用的是linux gentoo,我想安装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 

有更多版本的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 

如何select我想要的ebuild? (蟒-2.5.4-R4)

更新

@Ophidian emerge -av =python-2.5.4-r4 works ..谢谢

我相信Python是开槽的,所以你应该可以有多个版本共存,没有问题。

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

 emerge -av =python-2.5.4-r4 

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

 emerge -av python:2.5 

有些链接可能会对您有所帮助:

  • Portage介绍手册
  • Portage部分从手册
  • emerge 手册页
  • Gentoo-Wiki portage页面

其实你不需要指定完整版本。 更合适的方法是

emerge -av python:2.5

make.conf中还有一个有用的variables,用于升级依赖于python的包:

 USE_PYTHON="2.6 3.2" 

由于它是一个开槽的软件包,所以可以按照@LXj已经显示的方式安装多个版本。 在安装另一个版本之后,如果你想使用它作为默认值,你应该通过eselect python <version>select它 – 使用eselect python list检查可用的版本。 下一步,强烈推荐的步骤是运行python-updater (包app-admin/python-updater ) – 按顺序安装python安装非常重要,因为整个portage都是用该语言编写的。