Why I love Gentoo

After doing an emerge world on an older box I get:

* Messages for package sys-libs/com_err-1.40.4:

* PLEASE PLEASE take note of this
* Please make *sure* to run revdep-rebuild now
* Certain things on your system may have linked against a
* different version of com_err -- those things need to be
* recompiled.  Sorry for the inconvenience

In other words, “This update is going to break your system. We kind of screwed up. Something changed. Here’s how to fix it.”

So now I don’t have to google around frantically trying to figure out why randomserviced is suddenly failing. And the Gentoo guys even apologize.

Honesty, transparency, and humility in software. Go figure.

Gentoo Compiler Caching

I really should learn to be more patient and read the docs. Today I stumbled across Gentoo compiler caching. From the About ccache section:

ccache is a fast compiler cache. When you compile a program, it will cache intermediate results so that, whenever you recompile the same program, the compilation time is greatly reduced. In common compilations this can result in 5 to 10 times faster compilation times.

Sheesh. How much time have I wasted sitting around drooling on myself waiting for portage to build package XYZ?

In addition to learning to read the docs I should also probably learn to stop drooling on myself.

Upgrading legacy Redhat 9

I find myself stranded with another piece of shrike Redhat 9 server, somehow sold to an Indian client by Redhat India. (You’d think they would have the decency to say “by the way, there’s the project called Fedora..”) Anyway, I’m eventually going to try to bodysnatch it, but until then it desperately needs some package upgrades, and there’s no way I’m paying for RHN.

Here’s how to do Redhat 9 upgrades for free:

  1. Head over to the excellent RPM repository for legacy and recent Redhat/Fedora distributions maintained by Dag Wieers. He also has a tool called “rpmforge” which seems to help manage the packages (though I haven’t fully figured it out yet — maybe its just the config files for apt, up2date, yum, etc.) From RPMForge.net:
  2. The RPMforge.net project is an independent community-driven project to provide the infrastructure and tools to allow users, developers and packagers to meet and work together to provide and improve RPM packages.

  3. Check the FAQ for the appropriate RPMForge RPM. Install.
  4. Install the appropriate yum RPM. (Though I experimented with up2date, I could only get yum to work. apt-get is also probably okay..)
  5. Copy the yum configuration from /usr/share/doc/rpmforge-release-0.#.#/rpmforge.yum into /etc/yum.conf.
  6. Make sure that baseurl and mirrorlist are uncommented and correctly configured in yum.conf. (This bit threw me.. I have no experience with yum since going Gentoo.)

And that should do it. Running yum update from the command line will do a global system update for you. yum list updates will show you what’s available.

YoLinux has a delicious little yum tutorial, as well as a link to upgrading across releases if you want to enhance flavor and keep the hat on.

mod_perl on Gentoo

mod_perl doesn’t play so nice with Gentoo. Perl and, specifically, g-cpan still seem to have problems.

I’ve been scratching my head (read: driving my head into my desk) over the following error:

Can't locate lib.pm in @INC (@INC contains: blah blah blah) at /etc/apache2/modules.d/apache2-mod_perl-startup.pl line 1.\nBEGIN failed--compilation aborted at /etc/apache2/modules.d/apache2-mod_perl-startup.pl line 1.\nCompilation failed in require at (eval 2) line 1.\n

Thanks to an obscure post at the bottom of a thread from a couple of years back I was able to fix it with

# perl-cleaner reallyall
# emerge libperl

perl-cleaner appears to be like revdep-rebuild, but Larry Wall style.

Now I can run Apache::ASP.

Thank you crazy Larry Wall people.

Default .emacs on Gentoo

Just a quick follow-up to Practicing Safe Emacs. Everyone knows that Gentoo is the greatest distro on the planet, superior in all ways to RedHat. Anyway, in Gentoo it’s possible to create a generic .emacs file for all users. A great way to ensure that everyone is, among other things, practicing safe editing.

To set this up, simply cons the commands you want into

/usr/share/emacs/site-lisp/site-start.el

and the config commands will be applied to all users. See the Gentoo Wiki Tip on using this to load Portage-installed Emacs packages.