Deleted Python - how reinstall2007-11-20 08:27

You could try to boot the livecd, open a console and try to emerge python with

ROOT=/mnt/yourmountedlinuxpartition PKGDIR=/mnt/cdrom/packages emerge -av --usepkg python

引用: --usepkg (-k)
Tells emerge to use binary packages (from $PKGDIR) if they are
available, thus possibly avoiding some time-consuming compiles.
This option is useful for CD installs; you can export
PKGDIR=/mnt/cdrom/packages and then use this option to have
emerge "pull" binary packages from the CD in order to satisfy
dependencies.
引用: ROOT = [path]
Use ROOT to specify the target root filesystem to be used for
merging packages or ebuilds. This variable can be set in
make.conf(5) when PORTAGE_CONFIGROOT has a value other than /.
Defaults to /.

If that doesnt work you could try to find a binary package of python on the web ( a binary package for other distros will do too, it only has to be the version for your system, e.g. x86 / amd64 ). If you take a binary package for debian or ubuntu you could simply unpack it AFAIK. Yet this is not a clean solution because you willl have files on your system that are not tracked by portage.

------------------------------------------------------------------------------------------------------------------

# cd
# tar xzf /usr/portage/distfiles/Python-2.2.1.tgz
# cd Python-2.2.1
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2>/dev/null
# ln -s /usr/bin/python2 /usr/bin/python

Gentoo emerge -C python后的解决办法   今天升级我的gentoo ,emerge -uDN world 时发现有好多的portage被block,其中有就有python 与python-updater这两个包,一不小心将python 给emerge -C 掉了,现在惨了,emerge不能用了。才知道emerge 是运行在python环境上的。怎么办?

  解决方法:
  1,在另一台装gentoo的电脑上执行
  #quickpkg python   < 将python 打包,你可能要在/usr/portage/packages 建立这个目录 >

  2,将/usr/portage/packages/All/python-2.4.4-r5.tbz2 拷贝到 emerge -C python的电脑上

  3,在坏电脑上将python-2.4.4-r5.tbz2 解压到tmp中
  # tar jvxf python-2.4.4-r5.tbz2 -C /tmp

  4,将/tmp/usr/目录下的bin、lib中的内容分别拷贝到 /usr/bin 与 /usr/lib 目录下。

  应一切OK了。