OK guys, after I figured that lot of people had problems regarding this, I thought a script is in order and hence a separate thread.

WARNING: I have verified each and every step in this script. I have everything in there from my own experience. Before you attempt to use it, make sure that you have a backup of the system(for weak hearted guys...). Have a look at the script and know what it does. Although, its not destructive in the sense that unless and until you emerge glibc straightaway, you are safe. Don't emerge glibc,gcc,binutils,baselayout. Alias emerge to something which asks for confirmation if its not "emerge -p <>". And if e.g. "emerge -p tar" tells you that its going to emerge binutils, make sure to inject binutils first. Make sure you have enough space in /(roughly at least 1GB). Just a friendly warning...

No specific reason for anything other than baselayout, glibc, gcc, binutils, I usually update these fabfour with up2date once in a while. These four you should never emerge on redhat/fedora. Remember, services are handled by different mechanisms in gentoo and other distros, so anything which has to do with services you can't really emerge because you didn't emerge baselayout and hence don't have rc-update script. you could hack around them though.

perfect for keeping xfree, gnome, multimedia kind of stuff up2date.

Good luck.

EDIT: How can I forget to thanks Crichards for floating this idea here? Thanks crichards!! please refer this thread as well:

EDIT: mar 10, 05
existing ld.so.conf is killed by portage because it doesn't know about redhat installed stuff. Fixed this in the script.
/EDIT

EDIT: feb 21 '05
update the script for latest portage. I link /etc/make.profile with gcc34 profile, feel free to change to your taste after installing. also, I do emerge gcc,binutils now on my FC2 install, works out better. so apart from some very specific stuff like sysvinit, baselayout, glibc you can pretty emerge whole system. I did a custom nitro2 install sometime back using portage on FC2, works out fine.
/EDIT

EDIT: 03-03-2004

Somebody posted the link for rescue tars in responses, just updating it here at the top:

Wow! Not a single response. This is a great news for gentoo! A lot has changed since jan last year. I thought lot of people didn't want to re-install linux and just wanted portage to work on their distro so they could have the best of both worlds. But I think most people have already jumped ship to gentoo(or they don't understand the beauty the portage is). And after having used the former favourite distro for a while alongwith Gentoo, I know why I shouldn't ask "why"?

Wow! Not a single response. This is a great news for gentoo! A lot has changed since jan last year. I thought lot of people didn't want to re-install linux and just wanted portage to work on their distro so they could have the best of both worlds. But I think most people have already jumped ship to gentoo(or they don't understand the beauty the portage is). And after having used the former favourite distro for a while alongwith Gentoo, I know why I shouldn't ask "why"?

I totally jumped ship from Mandrake to Gentoo. It was time to learn all I could about Linux in general and what it really takes to run this OS. While I have certainly hit a number of bumps (most notably ALSA with nForce2), these forums (especially the Documentation, Tips & Tricks one) really made a HUGE diffference in helping me overcome those areas that I wasn't sure about. Also, the installation docs are by far some of the best I have ever seen. I've pointed several of my Windows co-workers at them and even they agree that anyone can install Gentoo. Kudos to everyone here and I'm looking forward to installing the 2.6.x kernel....once Gentoo updates their documentation

upgrading to 2.6 is easier than it looks...I would recommend gentoo-dev-sources (instead of development-sources) mainly for acpi and bootsplash, if you are not into "patching the kernel yourself" kind of mode...

devsk, you're a genius! I'm slowly but surely getting this going on a RedHat9 server... it's been slow-going, but I've got hopes that it will pull through... I would've just gone with Gentoo on the server if it was my decision, but it isn't so I'm trying to make admin'ing it as painless as possible..

I've tried copying over 'g++' from my gentoo laptop (which runs a different version of gcc (3.2.3-r3) and that didn't work. I even symlinked g++ to gcc (version 3.3.2) on the RH system, but that didn't work either. I installed GCC on the Red Hat system via rpm.. How should I properly get 'g++' working? Not being a good programmer, I don't know what to do..:-/_________________only the paranoid survive

i've tried this on a redhat 8.0 install.
it seems to work for the most part.
i didn't run the script directly, just typed out each command in the script one by one to make sure everything worked. a couple of points to note:
- the newest portage is portage-2.0.50-r1.tar.bz2
- useradd fails with the -G option because the group is already created in the previous step. using -g instead works.
- `emerge -p glibc|grep ebuild|cut -d" " -f8` includes all of the dependencies of glibc including gcc and binutils so there's no need to inject them seperately.
- a couple extra symlinks are needed to get rid of some errors during emerges:
cd /etc/init.d
ln -s /sbin/depscan.sh .
ln -s /sbin/functions.sh .

Hi I love portage and I have been trying to get this script to work on a Slackware 9.1 install (mainly because I simply don't have the time to invest 72 hours+ to get Gentoo up and running - I've done it about 8 times already and I think that's enough to show how capable I am). However Slackware just does not have the same range of sofware that Gentoo has.

The main problem when I run this script is that - well to be honest it doesn't work: Here is the way I have laid it out and also the output I got after running it. (I had to move most of it over to the left to line up with the command prompt - as the html formatting above seems to have knocked it out of line - or to put it another way it just wouldn't run at all like that.

Here is what I did and the ouput I got:

Code:

#!/bin/bash
#
# call with one argument "again" or call it with no arguments at all
# call it with no arguments first time.
# call it again with "again" to bypass some operations.
#

Something wrong. Get /usr/portage/profiles dir from a working
Gentoo system and try again.

bash-2.05b#

I checked and /usr/portage/profiles is there - but what would be the point of getting one from a working portage install just to copy it? I mean if I did that I would need to install Gentoo - and if I did this, why wouldn't I just keep it?

Any help anyone can offer would be very much appreciated, I was really hoping that someone would come up with a working script to do this some day.

all "if" statements have failed with "command not found"....shell 'export' fails...that's old 'sh' behaviour, not bash behaviour. Try save the script as Portage (w/o .sh) and then run it, make sure /bin/bash is not pointing to /bin/sh (older sh) and BASH_ENV is set to some sane script.

that copy to python2.2/site-packages is not required for portage 2.0.50, I will remove it from the script. simply cut and paste the script again. it works without any editing/identation/editing required.