This section will tell you how to manually update/fix your portage installation
in case you can't run
The first step to do is to get the tarball of a current portage version. In the
following text we will use
Depending on the exact reason portage doesn't work for you anymore it may still
be possible to use it to fetch the tarball for you, so as a first step please
try to run
# wget -P /usr/portage/distfiles http://distfiles.gentoo.org/distfiles/portage-2.1.8.tar.bz2
After that you should have the tarball available as
The next step is to unpack the tarball to a temporary location, using
# cd /root # mkdir portage-recover # cd portage-recover # tar xfj /usr/portage/distfiles/portage-2.1.8.tar.bz2
After you have done this it's just a matter of replacing the python and bash files of your existing installation with the ones from the tarball (in most cases anyway). To do so please run:
# cd /root/portage-recover/portage-2.1.8 # cp -R pym bin /usr/lib/portage/
If you are not using Gentoo on FreeBSD then you should remove the sed wrapper script since it's not needed and it is known to cause problems with old versions of bash:
# rm -f /usr/lib/portage/bin/sed
Now you should have a working portage install again. To ensure a consistent
system state however you should now run
If you get a
# ln -s ../lib/portage/bin/emerge /usr/bin/emerge
If these steps didn't work for you your problem is likely not a broken portage
installation but something else beyond the scope of this document. Please
recheck the