# Installing Portage on Other Distros

## crichards

MOD EDIT:Locked this one, but only because the discussion appears to have moved here. If anyone needs to edit their posts in here, drop me a PM. --plate

Yes, its possible. Yes, it works fine. I risked my perfectly stable Linux install to do this. And I'm still using it. Only its Gentoo-ified.

requires:

Python 2.2.x

Development Packages (gcc, binutils, automake, autoconf, libtool, etc)

Patience

Go to any Gentoo mirror, and download the portage tarball. Uncompress it, and go down.

```

cd bin/

cp * /usr/bin

cd ../pym

cp * /usr/lib/python2.2/site-packages

cd ../man

cp *.1 /usr/man/man1

cp *.5 /usr/man/man5

cd ../src/missingos

./setup.py install

cd ../sandbox-1.1

make && make install

cd ../../cnf

cp * /etc

cd ..

cp make.profile/ /etc

```

You now have a basic working Portage installation. As root, emerge sync. This will install the Portage tree. Now, this is where you customise stuff. Go to /usr/portage/profiles, and copy in the proper profile for your install. If you're using gcc-3.2, use one of the 1.4 profiles (the one for your arch). If not, use default.

Now, edit your /etc/make.conf and add any USE variables you want. Read /usr/portage/use.desc for more information. If you use gcc-3.2, add COMPILER="gcc3" to your make.conf.

Now, if you try to emerge anything, it will really complain about dependencies. Simply do the following to get rid of glibc complaints:

```

emerge inject sys-libs/glibc-version.

emerge inject sys-devel/gcc-version

```

emerge anything, and it may or may not complain about tar. If it does, go to the requested line in ebuild.sh, and change all instances of --no-same-owner to --same-owner. Then emerge tar

```

emerge tar

emerge sed

emerge bash

emerge pmake

emerge sys-apps/baselayout

emerge portage

```

baselayout installs init. Read the Gentoo docs for more.

You should be good to go now. I emerged a new gcc and many of my system tools (if you emerge awk, emerge man and less, too)

I'll add more in a bit.

----------

## Carlos

That's...  beautiful.  I'll be stayinig with 'regular' Gentoo myself, but I wouldn't be surprised if a small but crazy gorup of LFS/portage users materialized.

----------

## zhenlin

You've essentially described how to transform any linux system into a gentoo linux system... Hmm, what if we put this code into an architecture independent virus (sh script) and let it loose?

----------

## dreamer3

 *zhenlin wrote:*   

> You've essentially described how to transform any linux system into a gentoo linux system... Hmm, what if we put this code into an architecture independent virus (sh script) and let it loose?

 

The only flaw with this being all the unmanaged files that exist on such a system BEFORE it's converted to Gentoo.  Files from old versions of programs that don't get removed when the new versions get emerged.  Sure the important things (executables) will just be overwritten, but a lot of junk is bound to be left laying behind... not to mention how the different distros (to some small extent) deal with placement of things on the filesystem.

----------

## scrllock

which is why this works best with LFS, since you could install portage as part of the normal "install". Dang i love linux.

----------

## dreamer3

 *scrllock wrote:*   

> which is why this works best with LFS, since you could install portage as part of the normal "install". Dang i love linux.

 

Agreed.  But if you're starting "from scratch" why not just install Gentoo period... as far as I can tell it's really the same thing but with automated scripts and a managed package system.

----------

## darktux

 *dreamer3 wrote:*   

>  *scrllock wrote:*   which is why this works best with LFS, since you could install portage as part of the normal "install". Dang i love linux. 
> 
> Agreed.  But if you're starting "from scratch" why not just install Gentoo period... as far as I can tell it's really the same thing but with automated scripts and a managed package system.

 

former lfs user here. Agree with you dreamer3. But you'll learn A LOT more with lfs   :Wink: 

----------

## dreamer3

 *darktux wrote:*   

> former lfs user here. Agree with you dreamer3. But you'll learn A LOT more with lfs  

 Agreed.  I've learned a LOT more  just using Gentoo as opposed to any point-and-click install distro (Red Hat and Mandrake) and had a lot fewer unsolvable problems due to my increased knowledge of the system.

I'm sure that LFS would be even more so, of course the trade off it always time.  I would guess Gentoo to be a good balance for a lot, hence it's popularity.

----------

## scrllock

Well, right now I'm running gentoo... Slowly working on installing LFS on a spare 5 gig partition. Its gonna be sweet.

----------

## dreamer3

 *scrllock wrote:*   

> Well, right now I'm running gentoo... Slowly working on installing LFS on a spare 5 gig partition. Its gonna be sweet.

 

What do you hope to gain with your LFS install?

----------

## TheMad

How's portage working out for you now that you've had it for a while?  Is there any weird stuff thats happening as a result of installing it on Slack.  Reason I'm curious is that I'm about to install it on my LFS system which I just finished making and I'm wondering if I should be worried about all the old packages (not that I have all that many, as its a fairly fresh install).

TheMad

----------

## TheMad

Well, I've discovered a rather fatal flaw in your method of installation, namely that the make.profile folder does not exist, at least not in any portage tarballs I downloaded  =\

TheMad

----------

## DooBeDooBeDo

```
ls -l `locate make.profile`

lrwxrwxrwx    1 root     root           37 2002-10-01 23:32 /etc/make.profile -> /usr/portage/profiles/default-x86-1.4
```

You may, of course, wish to create the link to one of the other profiles.

----------

## TheMad

I do not have that profile anywhere on my computer.  I am trying to install portage onto linux from scratch and my only other distro is Slackware.  As such, I have no files particular to gentoo that aren't part of the portage-2.0.47 package.

TheMad

----------

## Kumba

Here is one for people to ponder.  I'm helping with Gentoo/Mips right now, but After seeing this thread, I suddenly gained a bright idea regarding the PS2 Linux port.  Currently, it seems PS2 Linux is based on Kondara Linux, itself is based off of RedHat.

I was thinking, would this idea be usable to morph a PS2 Linux into a semi-hybrid Gentoo system?  Part of it first requires gettong Gentoo to work on MIPS machines more, and from what I've seen, PS2 Still relies on a 2.2.x Kernel, which may make using an advanced distro somewhat difficult.  The PS2 Linux site doesn't seem to have anything in the way of 2.4.x kernels on PS2 Linux systems, although a post from the xRhino team indicates they are working on 2.4.x, but that post was made in June of 2002.

Does anyone here have PS2 Linux, and have they considered running something more advanced than some Redhat-based system on it?

--Kumba

----------

## Carlos

 *Kumba wrote:*   

> Here is one for people to ponder.  I'm helping with Gentoo/Mips right now, but After seeing this thread, I suddenly gained a bright idea regarding the PS2 Linux port.  Currently, it seems PS2 Linux is based on Kondara Linux, itself is based off of RedHat.
> 
> I was thinking, would this idea be usable to morph a PS2 Linux into a semi-hybrid Gentoo system?  Part of it first requires gettong Gentoo to work on MIPS machines more, and from what I've seen, PS2 Still relies on a 2.2.x Kernel, which may make using an advanced distro somewhat difficult.

 I don't think the 2.2.x kernel would be a big problem, since it's possible to run Gentoo with a 2.2.x kernel.  The much bigger problem is that Gentoo doesn't really support the MIPS architecture, so there's no ~mips arch in Portage, so you'll have to make or modify existing ebuilds to get a workable system.  I'm not sure what the difficulties in portig Gentoo to MIPS would be (heck, I don't know anything about MIPS except that it's Another Architecture), and I've heard about some recent attempts on the GWN, so you may want to check that out.

----------

## Gibberx

Maybe this will make it easier to get Gentoo Linux running on Xbox! I still haven't modded my Xbox or anything, since my siblings got me Xbox Live service for Christmas I'm actually playing the thing now. And if I mod it, *poof* no more Xbox Live.

----------

## jjj

Anybody know what solutions can be used instead of Portage for installing packages on various Unix Platforms ? (i.e Solaris, IRIX, ....)

----------

## Carlos

 *jjj wrote:*   

> Anybody know what solutions can be used instead of Portage for installing packages on various Unix Platforms ? (i.e Solaris, IRIX, ....)

 Hmm, installing packages on other Unices.  I guess since there aren't likely to be binaries for your platform or a ports system like with Gentoo or FreeBSD you'll just be stuck building them by hand.

----------

## fu_fish

Has anyone been able to use this method on a machine where they don't have root access?  I have a very fast machine at work and a very slow one at home.  I'd love to find a way to build binary packages while I'm at work and then install these packages at home.

----------

## Carlos

 *fu_fish wrote:*   

> Has anyone been able to use this method on a machine where they don't have root access?  I have a very fast machine at work and a very slow one at home.  I'd love to find a way to build binary packages while I'm at work and then install these packages at home.

 From the emerge manpage:

```
       --buildpkg (-b)

              Tells  emerge to build binary packages for all ebuilds processed

              in addition to actually merging the packages.  Useful for  main-

              tainers  or  if  you  administrate multiple Gentoo Linux systems

              (build once, emerge tbz2s everywhere).  The package will be cre-

              ated in the ${PKGDIR}/All directory.
```

If you combine that with whatever option keeps the package from being merged, as well as making sure that your packages get compiled with the flags for the slow machine (okay, this is looking increasingly difficult), you should be able to do it.

Ah, there we go, this has been treated before.  Read this:https://forums.gentoo.org/viewtopic.php?t=27214

----------

## crichards

I've been using it for quite a while, and its worked perfectly. I am having some problems with Qt/Xft (I already filed a bug), but it doesn't seem to have been caused by Portage. Rather, by my infinite carelessness.

It should work fine everywhere. I have the HOWTO on my site now. I'm going to be reinstalling from a Gentoo CD (because my system is too stable, it needs to be beaten with a stick), so thats about it.

----------

## meteo

what about NOT installing it in

       /usr/bin, /usr/man, /usr/lib/python2.2, etc.

but rather

       $GENTOO/usr/bin, $GENTOO/usr/man, ...

where (for example) GENTOO=/home/meteo/gentoo ? any possibility? I guess chroot won't do?

regards, m

----------

## drakos7

Anyone get this procedure to work under redhat? I cannot emerge anything. I keep getting the  

```
all ebuilds that could satisfy "blah" have been masked.
```

And yes, I am root and I have tried ACCEPT_KEYWORDS='~x86' also.

----------

## emarkham

I followed the insructions to the letter and i've run into a strange error:

```

root@unamerican:/usr# emerge tar

aux_get(): (0) Error in sys-apps/tar-1.13.25-r1 ebuild.

               Check for syntax error or corruption in the ebuild. (--debug)

Calculating dependencies   

!!! all ebuilds that could satisfy "tar" have been masked.

!!! Error calculating dependancies. Please correct.

root@unamerican:/usr# 

```

the funny thing is, when I run emerge in --debug mode, i get this weird error:

```

sh: /usr/sbin/ebuild.sh: No such file or directory

```

Thinking that I was just missing this file, i went and looked for it on my Officially Sanctioned Install (tm)  machine and lo and behold, the file does not exist there. I can't find this file anywhere, nor can i find it referenced anywhere in the .ebuild files.

at first blush, i'd say this is a bogus error. but what the heck do i know  :Smile: 

any help would be... helpful...

also, does anyone know why emerge would be complaining that all my .ebuild files are corrupted after doing an 'emerge sync'? The first sync completed correctly and if i nuke /usr/portage i am able to sync but after that, emerge complains.

thanks y'all

----------

## drakos7

I have the same error message. I should have posted it.   :Embarassed:   I have not found a way around it yet.

----------

## vijeno

On my RedHat box, I'm getting (after emerge tar):

aux_get(): (1) couldn't open cache entry for sys-apps/tar-1.12.25-r1

As far as I've reviewed the sources, it looks for /var/cache/ebd/dep/sys-apps/tar-1.12.25-r1

...but what now?

----------

## vijeno

Ohhh kay... an emerge regen obviously "re"constructs the

cache...

Now for the next challenge:

# emerge -p "[WHATEVERITRY]"

These are the packages that I would merge, in order:

Calculating dependencies

!!! all ebuilds that could satisfy "[WHATEVERITRY]" have been masked.

----------

## jnewland

when i try and run the `./setup.py install` command, i get this error message::

```

[localhost:~/portage-2.0.47-r10/src/python-missingos] jnewland% ./setup.py install

running install

running build

running build_ext

building 'missingos' extension

skipping missingos.c (build/temp.darwin-1.4-PowerMacintosh-2.2/missingos.o up-to-date)

gcc -L/sw/lib -bundle -bundle_loader /sw/bin/python build/temp.darwin-1.4-PowerMacintosh-2.2/missingos.o -o build/lib.darwin-1.4-PowerMacintosh-2.2/missingos.so

/usr/bin/ld: Undefined symbols:

_lchown

error: command 'gcc' failed with exit status 1
```

any ideas? this is stumping me.

----------

## ribo

what would be really interesting if it could work on QNX or Be  :Smile: 

----------

## relyt

 *emarkham wrote:*   

> the funny thing is, when I run emerge in --debug mode, i get this weird error:
> 
> ```
> sh: /usr/sbin/ebuild.sh: No such file or directory
> ```
> ...

 

->

```
cd /usr/sbin

ln -s ../lib/portage/bin/ebuild.sh .

ln -s ../lib/portage/bin/ebuild .
```

-then try again.

You also might want to

```
emerge portage
```

afterwards just to make sure that it gets completely set up.

----------

## ixion

this is an excellent idea, but it is buggy and messy... something I have decided to abandon due to the shakiness of it all...

but anyway, here are some pointers I've discovered in my endeavors to create and lfs system with portage:

1. you have to create the wheel group and give it permission to 'su'

2. add the portage user and groups to /etc/passwd and /etc/group (respecitively) (emerge will complain about it and give you what you need to know, don't worry;))

3. download and install rsync source code (won't be able to use emerge, yet)

4. Create symlink of /usr/bin/rsync to point to /usr/local/bin/rsync

5. Emerge sync

6. copy /usr/bin/ebuild* /usr/sbin/ebuild* (NO SYMLINKS! it caused problems for me)

7. Before emerging tar, backup the two ebuild.sh's you just created and REMOVE --no-same-owner instances in each file. Do not change them to --same-owner, it causes permission problems (at least for me)

This is where I'm at:

while emerging 'tar' I get random make errors after getting a tar error with zlib. I'd love to keep going with this, but the sloppiness of it really isn't worth it, although it is an excellent idea, and I highly commend crichards for coming up with all this.

----------

## InteRfacE

 *Phantom wrote:*   

> Maybe this will make it easier to get Gentoo Linux running on Xbox! I still haven't modded my Xbox or anything, since my siblings got me Xbox Live service for Christmas I'm actually playing the thing now. And if I mod it, *poof* no more Xbox Live.

 

There are projects out there to inject linux bootcode into the existing BIOS through savegame load buffer overflows, but im not sure whether or not that will mess up xbox live...

----------

## yur

 *Quote:*   

> 
> 
> About these errors:
> 
> aux_get(): (0) Error in sys-apps/tar-1.13.25-r1 ebuild.
> ...

 

Instead of doing (cd bin; cp * /usr/bin) - first and second commands in suggested install batch, you need to put them into /usr/lib/portage/bin and install a symlink in /usr/sbin:

```

cd bin

mkdir -p /usr/lib/portage/bin

cp * /usr/lib/portage/bin

ln -s ../lib/portage/bin/ebuild.sh /usr/sbin

...

```

Anythere, once you get it working, emerge portage will reinstall everything in proper locations. So don't worry and try to put scripts into several locations.

Voila!

----------

## delta407

 *ribo wrote:*   

> what would be really interesting if it could work on QNX or Be 

 It would be even more interesting if it would work under cygwin!

 :Rolling Eyes: 

----------

## proxy

just out of curiosity, what are the posibilities of getting portage running on say a solaris system (sparc).  I realize that there are a few key binaries which will need to recompiled to the aparc arch, but in general as a python script based system i dont see why it should be terribly difficult.

also i would need to inject glibc, kerenel-source anything else that has a solaris equiv as part of base solaris OS.

typically, _most_ programs seem to compile fine for solaris so i dont think that will be main issue.

so, like i said, could anyone think of a way to tak this on?  (assume i have gcc, python, etc installed for solaris).

I think it would be a very interesting and useful thing as an (occasional) solaris user.

proxy

----------

## Epcylon

I am the maintainer of an unofficial apps installation here, where we install apps that are not on the sysadmins list of "things I want to support". For now we're building things manually from source, but that's really cumbersome and impractical.

So I was wondering... would it be possible to install portage and use it in this setting? We don't have root access, and everything has to be installed in /some/path/ instead of /usr/. Other aspects of gentoo are not needed, nor wanted, just portage and the ability to do things like: emerge xchat2  :Smile: 

What would I need to do in order to make this work?

----------

## synic

I have written a small perl script that will read a slackware package database and create "inject" entries in the gentoo portage database.  This will esentually let portage know all the packages that are already installed in slackware.

You can find it here:

http://www.4akwote.com/adam/convert

Note:  I wrote this in 15 minutes and uploaded it to get feedback.  I am aware that I am not the best programmer, and would like a real hacker to take a look at it.  Keep in mind that you must run this on a slackware system with portage freshly installed, and you must let it finish to update the counter file correctly.   I will also be working on this script, and upload updates as I finish them.

Thanks,

synic

----------

## David916

 *Quote:*   

> Agreed. I've learned a LOT more just using Gentoo as opposed to any point-and-click install distro (Red Hat and Mandrake) and had a lot fewer unsolvable problems due to my increased knowledge of the system. 

 

I wholeheartedly agree, I started out using RedHat, and while it's perfect for someone who doesn't need to really learn linux, I want to learn linux. Thanks Gentoo

----------

## bartok

 *crichards wrote:*   

> Yes, its possible. Yes, it works fine. I risked my perfectly stable Linux install to do this. And I'm still using it. Only its Gentoo-ified.
> 
> 

 

I want to run portage in a non-root location on a RedHat box.  I can't escape RedHat because the box is actually a cluster that supports many users, many of which use proprietary applications that are only supported on RedHat.  The cluster also runs bproc and a special kernel for it, and was shipped from the vendor (Linux Labs) based on RedHat.

On the other hand, keeping applications and libaries up to date on this box using RPM sucks, especially after being spoiled by Gentoo on my other machines.  I want to run a portage based set of applications and libraries in a non-root location so the basic cluster configuration and proprietary software packages and their support organizations never know the difference.  In the meantime, I can use up to date and optimized applications from a non-standard location.

So far, I have tried two things.  First, I tried modifying portage to run in a non-root location based on the guidelines posted in this thread.  This can probably be done right, but it was getting rather messy in my case.  I don't want to mess with this more without guidance from the portage wizards.

Second, I tried using the stage1 tarball and chroot to build a system similar to a normal Gentoo install, but in the chroot directory instead of root.  This actually builds applications, but the problem is that they don't work outside of the chroot.  The look in the wrong place, root, for libraries and such. 8-(

Thanks for any advice,

	John

----------

## Milamber

 :Idea: 

how modifying emerge to take a  parameter, say "--distrodir"

and also a paramter like "--configdir"

where the user could then use like :

emerge --distrodir redhat  --configdir ~/emergeconfig 

where ~/emergeconfig will contain the necessary files like make.conf, etc ?

would it be possible ?

----------

## David916

Anyone know if portage will work on an openbsd system?

----------

## neuro_mancien

when i try to emerge something, i get a "!!! No profile directory; system mode unavailable." message.

What's this profile directory ?

TIA

 :Shocked: 

----------

## Slinger

Can someone give me a link to the proper tarball?  The one I downloaded from the mirror has no directory structure like the steps we are walked through on the first post of this thread.

TIA

----------

## neuro_mancien

Hello,

when i'm trying to emerge somethin, i get this message : "!!! all ebuilds that could satisfy "tar" have been masked."

My accept keyword is set to ACCEPT_KEYWORDS="~x86", and i'm trying this as root.

When i try with --debug option, i get the same message : 

```
"bash-2.05a# emerge --debug tar

  Calculating dependencies

Parent:    None

Depstring: sys-apps/tar

Candidates: ['sys-apps/tar']

!!! all ebuilds that could satisfy "tar" have been masked.

!!! Error calculating dependancies. Please correct."
```

What can i do to correct it ?

----------

## TwoSlick

 *Quote:*   

> I am the maintainer of an unofficial apps installation here, where we install apps that are not on the sysadmins list of "things I want to support". For now we're building things manually from source, but that's really cumbersome and impractical.
> 
> So I was wondering... would it be possible to install portage and use it in this setting? We don't have root access, and everything has to be installed in /some/path/ instead of /usr/. Other aspects of gentoo are not needed, nor wanted, just portage and the ability to do things like: emerge xchat2
> 
> What would I need to do in order to make this work?

 

I don't have root access, and I have to do the exact same thing on a solaris box at work.  I would absolutely LOVE to run portage to update my apps.  This thread got me to thinking:   What if you could chroot to /some/path and untar a sparc stage-x to get basic programs, then use emerge from there to download any apps you need?  After that, just chroot again to install or update software!  :Very Happy: 

Anybody think that would work?   I'm think I'm gonna try it tomrrow.

EDIT******   Darn!  I just realized you need to be root to use chroot.  Any ideas on how to get around this?

- TwoSlickLast edited by TwoSlick on Fri Jun 13, 2003 6:34 pm; edited 1 time in total

----------

## essetee

I use LFS, why should I use the portage tree from Gentoo. Exemple : KDE 3.2 takes 9 hours to compile on my LFS, on my  gentoo it takes 32 hours.

So, better to compile my own stuff on my LFS system, rather than use Gentoo's portage system.

----------

## hackertype

This script gets portage installed on my i686 redhat 8.0 linux box:

```
wget http://gentoo.oregonstate.edu/distfiles/portage-2.0.48-r1.tar.bz2

mkdir tmp

cd tmp

tar xvjpf ../portage*bz2

cd portage*

cd bin/

cp * /usr/bin

cd ../pym

cp * /usr/lib/python2.2/site-packages

cd ../man

cp *.1 /usr/man/man1

cp *.5 /usr/man/man5

cd ../src/python-missingos

./setup.py install

cd ../sandbox-1.1

make && make install

cd ../../cnf

cp * /etc

cd ..

cp make.profile/ /etc 

echo "portage:x:250:250:portage:/var/tmp/portage:/bin/false" >> /etc/passwd

echo "portage::250:portage" >> /etc/group

cp /usr/bin/ebuild* /usr/sbin/.

ln -s /usr/portage/profiles/default-x86-1.4 /etc/make.profile

cp /usr/bin/extra_functions.sh /usr/lib/portage/bin/.

emerge sync

emerge inject sys-devel/gcc-3.2.3

emerge inject sys-libs/glibc-2.2.5

```

However when I emerge tar the compile of bzip2 fails.

Okay I figured out the problem.  CC and CXX weren't defined because the /etc/env.d directory was empty.  I copied the whole dir structure from a working gentoo machine and ran env-update.

All the following work fine:

emerge tar

emerge sed

emerge bash

emerge sys-apps/baselayout fails on berkely DB.

```
test ! -f /usr/bin/ranlib || /usr/bin/ranlib libdb_cxx.a

gcc -I/usr/include/db1  -c -D_GNU_SOURCE -I../dist/../include -D_REENTRANT  ../dist/../db_dump185/db_dump185.c

../db_dump185/db_dump185.c: In function `main':

../db_dump185/db_dump185.c:210: warning: assignment makes pointer from integer without a cast

../db_dump185/db_dump185.c:212: warning: assignment makes pointer from integer without a cast

../db_dump185/db_dump185.c:227: structure has no member named `seq'

../db_dump185/db_dump185.c:227: `R_NEXT' undeclared (first use in this function)

../db_dump185/db_dump185.c:227: (Each undeclared identifier is reported only once

../db_dump185/db_dump185.c:227: for each function it appears in.)

../db_dump185/db_dump185.c:232: structure has no member named `seq'

../db_dump185/db_dump185.c: In function `db_hash':

../db_dump185/db_dump185.c:260: structure has no member named `internal'

../db_dump185/db_dump185.c:262: structure has no member named `internal'

../db_dump185/db_dump185.c: In function `db_btree':

../db_dump185/db_dump185.c:287: structure has no member named `internal'

make: *** [db_dump185.o] Error 1

!!! ERROR: sys-libs/db-3.2.9-r2 failed.

!!! Function src_compile, Line 89, Exitcode 2

!!! Static build failed

```

----------

## dev-null-devil

I've seen many people installing portage on slackware and it works really good for them. However, with this information, you can gentooify any linux system, this has been something i've been dreaming of for a long time, i'll try to install it on slack tomorrow.

----------

## ricgal

to fix a Mandrake 9.0 install that could not complete.  :Sad:  Think the cdrom was too old to read the burnt cds properly, perhaps. Compaq deskpro 300 mhz system.)

Anyway, I am reading and rereading this. I have some of the tarballs downloaded onto a spare hard drive that is temp resident of my Mandrake 7.1 machine. The archiver in 7.1 can't seem to open bz2 files, either.

Really need to get up to date here, I see. Sorry for the rambling.  :Rolling Eyes:   :Crying or Very sad: 

----------

## raid517

Is it possible that someone could write an automated install script script that would get portage cleanly installed on other distos? There's a lot of good ideas here. Maybe they just need to be condensed into something that can be worked on and updated as new progress is made? I'm sorry for not being a coder - and therefore possibly a lamer in some people's eyes. But I just think portage rocks - and everyone should get a chance to experience the full extent of its power.

Q

----------

## hackertype

I've tried this about 10 times now on RedHat linux 8.0 and emerge portage fails every time.

----------

## TecHunter

 *hackertype wrote:*   

> I've tried this about 10 times now on RedHat linux 8.0 and emerge portage fails every time.

   :Sad: 

----------

## ChakanTGM

I wrote a tutorial on installing portage on Slackware. It's a lot clearer then what this thread might provide someone. You can get it here:

http://www.crackice.com

I'll also be making a Slackware package so installing will be easy as pie. The tutorial might work for other distros. I gave credit to everyone here that I assimilated information from.

----------

## klette

Tried to do this on my LSackbox, it just fails though  :Sad: 

Wants to compile the whole fucking system ( including kernel-header-2.4.19 :S )

There is no guide at crackice, where is it? 

Thanx for answers

----------

## vandahm

I use NetBSD on all my desktop computers and use Gentoo on my laptop.  I think it would be cool to be able to run Portage on my NetBSD machine, so that I can compile binary packages for the laptop on a much faster machine.  I don't need it to install NetBSD packages, since NetBSD's 'pkgsrc' does most of what Portage does.

NetBSD can execute Linux binaries, so I imagine that I could install a stage 3 tarball into a chroot environment and go from there.  Hmm....

Has anyone done this before?

Steve

----------

## raid517

Erm.. Yeah... I can't see the guide either... A guide and some nice easy to install packages would be cool.  :Smile: 

Q

----------

## Linuxnerdonthenet

Hi

I have tried this on an install of Aurora Sparc.

One thing you have forgotten to mention on this whole thing is the need to edit /etc/passwd and add 

portage:x:250:250:portage:var/tmp/portage:/bin/false

and edit /etc/group and add

portage::250:portage

You may also have to make sure default user is a member of wheel group.

Still trying to get it to work properly have an aux_get () syntak error or corruption to sort out now.

HTH somebody.

John

----------

## werfu

Thinking about it, could portage be installed on FreeDOS? I know this is weird, but it would be awesome.

----------

## Stu L Tissimus

FreeDOS?

o_O

----------

## orionrobots

After beginning this process on a mandrake 9.1 box, I get the error message: 

```

[java-config-0.2.8-r2] bash: line 1: /sbin/depscan.sh: No such file or directory

```

Having done an updatedb and locate for depscan.sh, I do not have this file anywhere.  Where can I get it?

I also think mandrake has a borked version of autoconf and automake - so my advice is grab the sources from a gentoo mirror, and build/install these.  Then remove the rpm's.  The rpms install them in different locations.

I have also had to create a number of symbolic links to X11 libraries and tools - which are probably expected to be in different places.

I am keeping logs of what I am doing as it may be helpful to someone else wanting to switch.  I cant stand RPM.

Orion

----------

## darksarin

like another poster mentioned, in the latest version of portage, there is no make.profile in any of the directories.  If someone could illuminate this error.  

I am using RedHat 9, and would love to have portage available, but need some assistance.  I get the following errors:

```
portage: 'portage' user or group missing. Please update baselayou and merge portage user(250) and group(250) into your passwd and group files.  Non-root compilation is disabled until then.  Also note that non-root/wheel users will need to be added to the portage group to do portage commands.

For the defaults, line 1 goes into passwd, and 2 into group.

portage:x:250:250:portage:/var/tmp/portage:/bin/false

portage::250:portage

!!!No profile directory; system mode unavailable.

```

I am going to try to get an older portage file so I can use that make.profile to work with.  Wish me luck and thanks for the info!

----------

## darksarin

followed the second code listing for the guy using rh8.0, and now, after finding the extra_functions.sh, I still get the following error:

```

[color=red]!!!CANNOT IMPORT FTPLIB[/color] libgssapi_krb5.so.2: cannot open shared object file: No such file or directory

```

It then tells me it is done calculating dependencies, but then refuses to download anything and aborts. ACK!

help--please!

----------

## gungholady

I tried adding portage to my slackware 9.1 with the instructions here. 

cp make.profile/ /etc does not work. The complaint is that make.profile does not exist. When I try to use emerge portage the complaint is that Python2.2 is not found. That is true because I have Python2.3. How do I solve this? How do I create a make.profile from scratch? When I tried the script found at http://www.4akwote.com/adam/convert to put the list of slackware packages that I have installed into /usr/portage I get the following errors:

onvert.sh: line 3: =: command not found

convert.sh: line 4: =: command not found

convert.sh: line 6: syntax error near unexpected token `$gentooPackDir'

convert.sh: line 6: `chdir( $gentooPackDir );'

Any help would be appreciated. I would like to convert my slackware to gentoo over time if possible. I only have dial-up so would really like to get this working.  :Confused: 

----------

## devsk

OK, we have got something here. I could successfully install the portage. And I tried some small fries like zip and unzip. It looks to work alright but I am little apprehensive about jumping on the big guys(like xfree) because I keep getting this error which I couldn't make much sense of:

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

/usr/sbin/ebuild.sh: line 179: eerror: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

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

can some developer please tell me what it means? because I don't see the name of the command which is not found. Is it something not set?

thanks a lot.

----------

## devsk

OK, I thought this is a story worth telling. So, listen.

Since, I couldn't for my life find out why I was getting those "command not found" errors, I figured it must be the baselayout. And off I went to emerge it. Result: my RH8 won't boot properly because Gentoo and RH have different concept of runlevels and the way they treat init is different.

It would go as far as runlevel 3 and give me login prompt.  After fiddling(adding stuff for boot,default) with rc-update for sometime, I rebooted. This led to corruption of my root partition, probably because of gentoo incomplete shutdown, after all its not gentoo... :Smile: 

Luckily, for me I had created a backup of my partition before starting on this adventure. So, I restore my partition(ghost 2002 doesn't know ext3 but tune2fs is useful), get into rescue mode, fsck it, "tune2fs -j" it, and finally grub it. I am up again.

Now I start on a mission of reverse engineering never ever taken before. .. :Smile:  Figured that baselayout is out of question. emerge --debug zlib on a good gentoo and on RH8. comparison yields that /sbin/functions.sh and /sbin/depscan.sh need to be present. Surprise! They are part of baselayout.  Some other parts(like /lib/rcscripts/awk/*.awk) of it are needed too. "emerge -f -O baselayout " fetched everything, manually untar and loot on whatever is needed minimally. Finally, "emerge gawk" got rid of "file_funcs.so not found".

And here I am with a working portage on RH8. proud of you, crichards, for floating this idea!

Thanks everyone.

----------

## jago25_98

Installing portage onto another distro replaces that distro so you lose all the reliability of that distro right?

 Is there a way to have 2 distros on one partition in order to save disk space etc and be able to switch between the two? ... possible by chroot?

 The reason I don't fancy the idea of seporate partitions is because I like to conserve disk space and one may grow more than another; you can't guess how much space you'll need in the future.

 Could we have a RedHat install with /usr/gentoo/usr/portage?

 - if so would that still not utilise any of the RedHat install? If the two distros are seporate however, it would still be handy having the 2 on a single partition.

 Next course of action - proper guide of some sort by someone who's done it?

----------

## longodj

```
mini# emerge sync

Operating system "FreeBSD" currently unsupported. Exiting.

```

whaaaaaaaaat?

----------

## Clock

 *Slinger wrote:*   

> Can someone give me a link to the proper tarball?  The one I downloaded from the mirror has no directory structure like the steps we are walked through on the first post of this thread.
> 
> TIA

 

The same happened to me. How to get it:

1) http://www.gentoo.org

2) grep mirrors, click the link

3) Find some machine near to you

4) goto distfiles/, wait until the huge directory loads.

5) get portage-*

s/missingos/python-missingos/

When copying into  site-packages/* I get a meassage: "Omitting directory new/".

I suggest this information to be added to the first post in this forum.

BTW I have experience with LFS. It's cool. I have experience with gentoo. It's cool too. I am going to install gentoo on my LFS so I'll get a Gentoo LFS which will be supposedly doble as cool  :Razz: 

And hey, the guide in the first post is fundamentally flawed. There is no make.profile anywhere.

----------

## devsk

 *jago25_98 wrote:*   

> Installing portage onto another distro replaces that distro so you lose all the reliability of that distro right?

 

Wrong!! If you are careful about not emerging certain distro specific packages, you will be fine.

 *Quote:*   

> Next course of action - proper guide of some sort by someone who's done it?

 

Follow these steps:

UPDATE: these instructions have been converted into a script at:

https://forums.gentoo.org/viewtopic.php?t=125553

/UPDATE

0. Make sure your system is quite updated in terms of glibc(2.3.2), gcc(3.3.2) and binutils(2.14.90) before beginning here because its very difficult to emerge these even after portage works correctly.

1. wget ftp://gentoo.mirrors.pair.com/distfiles/portage-2.0.49-r21.tar.bz2 -o /tmp/portage-2.0.49-r21.tar.bz2

uncompress it in /tmp with cd /tmp;tar xjf portage-2.0.49-r21.tar.bz2

2. mkdir -p /usr/lib/portage/bin; mkdir /usr/portage ; mkdir /etc/env.d

3. cd /tmp/portage-*/bin ; cp * /usr/lib/portage/bin

4. export PATH=/usr/lib/portage/bin:$PATH

5. cd ../pym ; cp * /usr/lib/python2.2/site-packages ; ignore any warnings.

6. cd ../man ;cp *.1 /usr/man/man1 ;cp *.5 /usr/man/man5

7. cd ../src/python-missingos

8. ./setup.py install

9. cd ../sandbox-1.1

10. make && make install

11. cd ../../cnf; cp * /etc

12. create group portage(250) in /etc/portage and add user root to it.

      create user portage(250) also with /var/tmp/portage as home.

13. COPY contents from /usr/portage/profiles from a working gentoo box to /usr/portage/profiles. I haven't been able to find where these come from(qpkg -f <>, not that useful after all). But its pretty generic thing, get it from any gentoo box.

14. ln -s /usr/portage/profiles/default-x86-1.4 /etc/make.profile.

15. Modify /etc/make.conf for your taste.

15a. create file /etc/env.d/compiler with these two lines:

     CC=gcc

     CXX=g++

source this file as well with ". /etc/env.d/compiler"

16. emerge sync; if it cribs in this step about missing files, just link /usr/lib/portage/bin/* into /usr/sbin and /usr/bin.

      ln -s /usr/lib/portage/bin/* /usr/sbin

      ln -s /usr/lib/portage/bin/* /usr/bin

After step 20, make sure to remove the links which are outdated in these two dirs, otherwise you will always be calling /usr/bin/ebuild.sh when /usr/lib/portage/bin/ebuild.sh is the latest one.

17. emerge inject <glibc version reported by sync>

18. emerge inject <gcc version reported by sync>

emerge portage

emerge -f baselayout.

untar baselayout from /usr/portage/distfiles/baselayout* in /tmp. cd /tmp/baselayout*/sbin; cp depscan.sh /sbin; cp functions.sh /sbin

mkdir -p /lib/rcscripts/awk

cd ../awk

cp *.awk /lib/rcscripts/awk/

emerge gawk

emerge portage

19. emerge inject <baselayoutversion reported by sync>

20. You should be all set to emerge most of the stuff.

Remember if you get into env. variable problems where PATH is not getting set properly for the newly emerged packages(like jdk in /opt/), /etc/env.d is the dir for you. env-update reads files in this dir to create /etc/profile.env file.

I had to create /etc/env.d/10ldpath with following line for ld.so.conf to work properly:

LDPATH="/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/usr/kerberos/lib"

 I had to source /etc/profile.env in /etc/profile as well. You might have to do something similar.

I use the following script to prune out all packages I have marked unsafe for portage on Fedora.

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

#!/bin/bash

emerge sync

emerge -p -uD world > /tmp/world.update

for i in `cat /etc/portage/package.mask.ORG` ;

do

  matching=`grep "$i" /tmp/world.update`

  if [ -n "$matching" ]; then

    toInject=`echo $matching|cut -d " " -f 4`;

    echo "Injecting $toInject"

    'emerge' inject $toInject

  fi

done

echo "#                                               #"

echo "################# UPDATES #######################"

echo "#                                               #"

cat /tmp/world.update

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

Currently, my /etc/portage/package.mask.ORG looks like this:

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

sys-apps/baselayout

sys-fs/devfsd

sys-kernel/linux-headers

sys-libs/pwdb

sys-libs/pam

sys-libs/pam-login

gnome-base/gdm

sys-apps/kbd

sys-devel/bin86

sys-devel/binutils

net-misc/iputils

sys-apps/shadow

net-misc/dhcpcd

sys-apps/slocate

sys-apps/modutils

sys-libs/glibc

sys-devel/gcc

sys-libs/ncurses

app-crypt/hashalot

sys-apps/cronbase

x11-base/opengl-update

net-nds/openldap

net-mail/mailbase

net-www/epiphany

net-nds/portmap

net-fs/samba

net-misc/openssh

dev-lang/python

sys-fs/e2fsprogs

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

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. 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.Last edited by devsk on Fri Jan 30, 2004 7:03 pm; edited 2 times in total

----------

## Clock

I get this strange error. I have been investigating in /var/tmp/portage*binutils* and realized first ./configure guesses system type to be "". However, config.guess guesses it correctly to be i686-pc-linux-gnu. It is caused by some strange variable "nonopts" that is set to "" from ac_opts even when ./configure is called without args (!!!) and then tested to NONE but because it's not NONE it doesn't call config.guess.

I forced it to call config.guess however it still writes the usage of config.status at which point I gave up.

Script started on Sat Jan 17 17:46:50 2004

root@beton:~$ emerge tar

Calculating dependencies ...done!

>>> emerge (1 of 17) sys-devel/binutils-2.14.90.0.6-r6 to /

>>> md5 src_uri  :Wink:  binutils-2.14.90.0.6.tar.bz2

>>> Unpacking source...

>>> Unpacking binutils-2.14.90.0.6.tar.bz2 to /var/tmp/portage/binutils-2.14.90.

0.6-r6/work

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

/usr/sbin/ebuild.sh: line 238: einfo: command not found

/usr/sbin/ebuild.sh: line 327: eend: command not found

>>> Source unpacked.

/usr/sbin/ebuild.sh: line 161: einfo: command not found

/usr/sbin/ebuild.sh: line 48: einfo: command not found

/usr/sbin/ebuild.sh: line 48: einfo: command not found

/usr/sbin/ebuild.sh: line 48: einfo: command not found

/usr/sbin/ebuild.sh: line 48: einfo: command not found

creating cache ./config.cache

checking host system type... config.sub: missing argument

Try `config.sub --help' for more information.

checking target system type... config.sub: missing argument

Try `config.sub --help' for more information.

checking build system type... config.sub: missing argument

Try `config.sub --help' for more information.

checking for a BSD compatible install... /bin/install -c

checking for ar... ar

checking for as... as

checking for dlltool... dlltool

checking for ld... ld

checking for nm... nm

checking for ranlib... ranlib

checking for windres... windres

checking for objcopy... objcopy

checking for objdump... objdump

checking for ar... ar

checking for as... as

checking for dlltool... dlltool

checking for ld... ld

checking for nm... nm

checking for ranlib... ranlib

checking for windres... windres

checking whether to enable maintainer-specific portions of Makefiles... no

updating cache ./config.cache

creating ./config.status

Usage: ./config.status [--recheck] [--version] [--help]

!!! ERROR: sys-devel/binutils-2.14.90.0.6-r6 failed.

!!! Function src_compile, Line 135, Exitcode 1

!!! (no error message)

Also can anyone advise where to get those "eend" and "einfo" commands? Everyone is desiring them here  :Wink: 

----------

## Clock

Don't you know how to get rid of this error?

emerge bash

/bin/install:cannot create regular file '/var/tmp/portage/bash-2.05-r7//image/usr/bin/bash': No such file or directory

I wonder why it needs the file to exist for creation? Did God also require this world to exist prior to creating it? If so, then God's task was dead simple.

----------

## devsk

I am in the process of writing a script to install portage on non-gentoo platforms. When I am done I will post it. I will appreciate if you tested that script.

If you decide to not wait/go with the script, for your error, you need to see steps where I untar baselayout and copy few .sh files to /sbin. Also, do you have portage user and group?

moreover, use emerge -p first to see what it will emerge. never emerge those "fabfour" packages on redhat.

----------

## romaninsh

 *Clock wrote:*   

> 
> 
> /usr/sbin/ebuild.sh: line 238: einfo: command not found
> 
> /usr/sbin/ebuild.sh: line 327: eend: command not found
> ...

 

you are missing /etc/init.d/functions.sh

----------

## devsk

as I mentioned above(after 17. in my longest post ever... :Smile: ), you need functions.sh and depscan.sh extracted from baselayout tar and put into /sbin...don't create unnecessasry file in /etc/init.d.

BTW, automatic install script for portage for other distros is in now available at:

https://forums.gentoo.org/viewtopic.php?p=786280

----------

## devsk

 *TwoSlick wrote:*   

> 
> 
> EDIT******   Darn!  I just realized you need to be root to use chroot.  Any ideas on how to get around this?
> 
> - TwoSlick

 

I just found out that "ROOT=/opt emerge -p -O zlib" installs just zlib package in /opt, with its own /opt/usr, /opt/bin, /opt/var, /opt/etc ...etc., with its own separate database. If you can handle /opt/etc/env.d and /opt/etc/ld.so.conf, you can be the king of your portage system!! Good news for users who don't have root access!

----------

## d0wn_under

I am following the instructions given by devsk but I am getting the following when I do the setup.py install

```

kyle:/usr/src/portage-2.0.49-r21/src/python-missingos # ./setup.py install 

running install

Traceback (most recent call last):

  File "./setup.py", line 22, in ?

    url = "",

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/core.py", line 138, in setup

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 893, in run_commands

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 912, in run_command

  File "/usr/lib/python2.2/cmd.py", line 112, in ensure_finalized

    line = self.cmdqueue[0]

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/command/install.py", line 267, in finalize_options

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/sysconfig.py", line 421, in get_config_vars

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/sysconfig.py", line 326, in _init_posix

distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.2/config/Makefile (No such file or directory)

```

I have tried touching the missing make file but that didn't help I got the following then

```

kyle:/usr/src/portage-2.0.49-r21/src/python-missingos # ./setup.py install 

running install

running build

running build_ext

Traceback (most recent call last):

  File "./setup.py", line 22, in ?

    url = "",

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/core.py", line 138, in setup

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 893, in run_commands

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 913, in run_command

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/command/install.py", line 491, in run

  File "/usr/lib/python2.2/cmd.py", line 330, in run_command

    print "\n"

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 913, in run_command

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/command/build.py", line 107, in run

  File "/usr/lib/python2.2/cmd.py", line 330, in run_command

    print "\n"

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/dist.py", line 913, in run_command

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/command/build_ext.py", line 231, in run

  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/distutils/sysconfig.py", line 142, in customize_compiler

TypeError: unsupported operand types for +: 'NoneType' and 'str'

```

Anyone any ideas?

I am doing this on Suse 8 installed straight from the cd's without real changes. I am using 

gcc (GCC) 3.3 20030226 (prerelease) (SuSE Linux)

could this be a problem (not with this but other things?

----------

## d0wn_under

Suse doesn't install the python dev libraries as default, as soon as I added those it worked!

----------

