Stupid Gentoo Tricks

What initially attracted me to Gentoo is its sometimes-elegant portage system, which is Gentoo’s version of a package manager — one of the things that distinguishes Linux flavors from one another.

Portage suffers from a sort of chicken-egg conundrum in that portage and all of its files and dependencies are themselves managed by portage, which means that upgrading libraries that everything relies upon can quickly lead to a system where portage becomes inoperative.

Recently, I managed to mangle “wget” by deinstalling a library it relied upon.  This is difficult to recover from since wget is essential to portage’s ability to install packages … such as wget and the libraries it requires.  I also discovered that an ftp client is not installed by default, which is surprising, but effectively ruled out just copying a working wget from another system.

As it turns out, the default Gentoo installation does include busybox, which is theoretically less functional, but will do the trick.  For those unfamiliar with busybox, it’s essentially one binary that contains (and is capable of replacing) a number of tiny command line functions, from cp and cat to rm and xargs.  If you have it installed, typing “busybox” will tell you exactly what command line tools it can replace.

Therefore, it’s possible to [re]install wget by telling portage to use busybox’s wget instead of wget itself:

FETCHCOMMAND="/bin/busybox wget \${URI} -P \${DISTDIR}" emerge wget

Tagged , , , , . Bookmark the permalink.

2 Responses to Stupid Gentoo Tricks

  1. Pravinkumar Chavan says:

    hi all
    but what if I want to use wget insted of Busybox wget.
    In my application I want to use wget -nc option in order to resume download and prevent it from redownloading the file which are previously downloaded.

    Can somebody help me.

  2. queued says:

    In that case… you just use wget.

    emerge wget

Leave a Reply

Your email address will not be published.

By submitting this form, you accept the Mollom privacy policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.