A few Gentoo tips

Mostly archived here for my benefit for when I break something with a reckless emerge -uDNAv world update again. *vbg*

  1. To install a binary version when something major's borked (like when you can't get anything to compile, including gcc, because you broke gcc…)
    • Go to tinderbox.dev.gentoo.org and find the correct directory for your machine. (For example, my AMD64 server uses binaries in the tinderbox.dev.gentoo.org/default/linux/amd64/ directory.)
    • Add this to your /etc/make.conf (or /etc/portage/make.conf), all on one line: PORTAGE_BINHOST="http://tinderbox.dev.gentoo.org/default-linux/amd64/"

      (Use the directory you chose in the previous step, obviously.)

    • To install the binary from tinderbox, use emerge -G $package. So, to install a gcc binary, you would type: emerge -G gcc
    • More info available here.
  2. To find out what a USE flag does:
    • euse -i $flag
    • So to find out what the multilib flag does, you would type euse -i multilib
    • Euse is part of the gentoolkit package, so you'll need to emerge that if you haven't already (emerge -uDNav gentoolkit).
  3. One way to fix the dreaded C++ preprocessor "/lib/cpp" fails sanity check error:
    • Update your active gcc version with a binary from tinderbox, as explained above. To see which gcc version that's installed on your machine the system is using as the default, type gcc-config -l. (That's an L for list.)
    • Make sure that gcc has the cxx USE flag enabled (in your /etc/portage/package.use or make.conf), so that it will build with support for C++ and won't break when rebuilt. (Ask me how I learned that flag was needed. Yeah. *vbg*)
    • Rebuild gcc (emerge -uDNav gcc).
  4. Typing emerge --info --verbose $package will tell you the system info and all the USE flags a package was built with, so you can see if the flags you needed enabled/disabled are.
  5. Older snapshots of portage are available if you are trying to update an older system that hasn't been updated in a while.
  6. List of USE flags
  7. Gentoo cheat sheet

What's your favorite tip or trick when dealing with an "oh crap, what the hell did I do?" moment?

Leave a Reply