Fandom

How To Wiki

How to install Gentoo emerge on a non-Gentoo Distribution of Linux

1,795pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

The Linux distribution, Gentoo Linux, uses a program called emerge to manage its packages. Emerge uses portage to install and manage its software, similar to BSD. Portage installs software by compiling from source instead of installing the binary. This allows the software to be optimized to your system, while most distributions use general binary packages. Through this HowTo you will be able to use emerge to update your entire system.


RequirementsEdit

Cost Time Difficulty Age Group
0$ 3h+ hard 12+
About:Ratings


  1. Computer with Linux
  2. Gentoo Stages tar balls, downloaded from the ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/current/stages/
  3. Software: tar, bz2, binutils (you should already have these installed)
  4. Working version of gcc, It may be a good idea to have a version of gcc installed in a place other than /usr or /usr/local

StepsEdit

  • Preamble: This HowTo is not an easy task, it requires a significant amount of knowledge in Linux. These steps will most likely NOT be replicatable, word for word, and will require a good knowlege of your system. It would be significantly easier to install Gentoo Linux from scratch.
  1. Make Directories:
    mkdir -p /usr/lib/portage/bin
    mkdir -p /usr/lib/portage/pym
    mkdir -p /usr/portage/profiles
    mkdir -p /usr/local/portage
    mkdir -p /etc/env.d
    mkdir -p /etc/portage/profile
    mkdir -p /var/log/portage
    mkdir -p /var/tmp/portage
    mkdir -p /etc/config-archive
    mkdir -p /var/lib/init.d
    mkdir -p /var/lib/portage
    mkdir -p /usr/man/man1
    mkdir -p /usr/man/man5
    mkdir -p /usr/portage/sys-apps/portage/files
  2. Download gentoo stages 1, 2, and 3 into an empty folder
    ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/current/stages/
    stage 1 is in x86, you can download stages 2 and 3 for your specific processor
  3. Untar all stages in the folder created. See: HowTo: Untar
  4. Copy usr/lib/portage to /usr/lib/portage.
  5. Untar portage-x.x.x & copy portage to /usr/portage
  6. Create a symbolic links to the portage bin directory by executing
    ln -s /usr/lib/portage/bin/* /usr/bin/
    ln -s /usr/lib/portage/bin/* /usr/sbin/
  7. Edit /etc/passwd and add
    'portage:x:250:250:portage:var/tmp/portage:/bin/false'
  8. Edit /etc/group and add portage::250:portage
  9. Copy /usr/lib/portage/pym/* to /usr/lib/python2.x/site-packages
  10. edit/create file '/etc/env.d/10ldpath' and add all you library directories in the file /etc/ld.so.conf
    LDPATH=/usr/kerberos/lib:/usr/X11R6/lib:/usr/lib/qt-3.1/lib:/usr/local/lib/:/usr/lib/sane:/usr/lib
  11. edit/create file /etc/env.d/05gcc and enter the following with the location to you gcc
    ROOTPATH="/usr/local/gcc-3.4.4/"
    MANPATH="/usr/local/gcc-3.4.4/man"
    INFOPATH="/usr/local/gcc-3.4.4/info"
    CC="gcc"
    CXX="g++"
    LDPATH="/usr/local/gcc-3.4.4/lib"
  12. edit/create the file /etc/env.d/compiler and add these lines:
    CC=gcc
    CXX=g++
  13. Exicute emerge sync
  14. edit/create /etc/portage/profile/package.provided and add the following
    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
  15. emerge -f baselayout
  16. untar /usr/portage/distfiles/baselayout*.tar.bz2 (aka rcscripts)
  17. cd {rcscripts}/sbin; cp depscan.sh /sbin; cp functions.sh /sbin
  18. ln -s /sbin/functions.sh /etc/init.d; ln -s /sbin/depscan.sh /etc/init.d
    This step cures these errors
    /usr/portage/eclass/eutils.eclass: einfo: command not found
    /usr/portage/eclass/eutils.eclass: eend: command not found
  19. mkdir -p /lib/rcscripts/awk; cd {rcscripts}/awk; cp *.awk /lib/rcscripts/awk/
  20. ln -s /usr/local/bin/gcc /usr/bin; ln -s /usr/local/bin/g++ /usr/bin
    Cures the make: gcc: Command not found
  21. emerge gawk
  22. emerge portage
  23. emerge sandbox
    solves !!! Problem with sandbox binary. Disabling...
  24. At this point emerge should work. You may have to manually edit some config files. If a package does not install and the solution is in Common Errors. install the package from source manually with ./configure --prefix=/usr, if the package still will not install, add the packages exact name to /etc/portage/profile/package.provided, and this will tell emerge that that package is installed manually and accept that this dependency is fulfilled. See: HowTo: Install a program from source.

Common ErrorsEdit

  • Error: !!! Problem with sandbox binary. Disabling...
    • Solution:
      emerge sandbox
  • Error:
    make: gcc: Command not found
    • Solution:
      ln -s /usr/local/bin/gcc /usr/bin; ln -s /usr/local/bin/g++ /usr/bin
  • Error:
    /usr/portage/eclass/eutils.eclass: einfo: command not found
    /usr/portage/eclass/eutils.eclass: eend: command not found
    • Solution:
      ln -s /sbin/functions.sh /etc/init.d; ln -s /sbin/depscan.sh /etc/init.d
  • Error: Package will not install
    • Solution: Install the package from source manually with ./configure --prefix=/usr, if the package still will not install, add the packages exact name to /etc/portage/profile/package.provided, and this will tell emerge that that package is installed manually and accept that this dependency is fulfilled
  • Error: configure.in:5: version mismatch. This is Automake 1.7.9,

configure.in:5: but the definition used by this AM_INIT_AUTOMAKE configure.in:5: comes from Automake 1.6.3. You should recreate configure.in:5: aclocal.m4 with aclocal and run automake again.

    • Solution: Reinstalling the old version of Automake sometimes helps, but not always
  • Error: Symlinking make.profile
    • Solution
  rm -f /etc/make.profile

  x86:
 # ln -sf /usr/portage/profiles/selinux/2007.0/x86 /etc/make.profile 
  x86 (hardened):
 # ln -sf /usr/portage/profiles/selinux/2007.0/x86/hardened /etc/make.profile
  AMD64:
 # ln -sf /usr/portage/profiles/selinux/2007.0/amd64 /etc/make.profile
  AMD64 (hardened):
 # ln -sf /usr/portage/profiles/selinux/2007.0/amd64/hardened /etc/make.profile
  • Error: Problem with /etc/make.conf
    • Solution Make.conf Example
  USE="3dnow acpi dedicated ethereal faad ffmpeg firebird freetype gtkhtml \
    apache2 xsl mysql mng openssh tiff -arts -kde -qt eds gd dba"
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
  CXXFLAGS="${CFLAGS}"
  ACCEPT_KEYWORDS="x86"
  PORTAGE_TMPDIR="/var/tmp"
  PORTDIR="/usr/portage"
  DISTDIR="${PORTDIR}/distfiles"
  PKGDIR="${PORTDIR}/packages"
  MAKEOPTS="-j2"
  AUTOCLEAN="yes"
  FEATURES="sandbox ccache"
  GENTOO_MIRRORS="ftp://ftp-mirror.internap.com/pub/gentoo/ http://www.gtlib.cc.gatech.edu/pub/gentoo \ 
               ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ \ 
               http://gentoo.mirrors.pair.com/ http://gentoo.seren.com/gentoo"

References/See Also/External LinksEdit

CreditsEdit

Also on Fandom

Random Wiki