NaNo Status

Recent Posts

Archives

Categories

Recent Comments


« insomnia is teh suck | Main | redhats named »

Things every new Gentoo admin/user should know.

By Jesse Morgan | December 19, 2005

I’ve been using Gentoo for over 2 years now. Before that it was Debian. Before that it was Redhat. Spattered inbetween I’ve used slackware, mandrake, suse, knoppix, ubuntu, xandros and sorceror.

I’ve noticed when I pick up a new distribution, there’s always little bits and tips that people forget to tell you about. I’m gonna try to make a list for gentoo.

emerge

Emerge is the main package management tool for gentoo- as such, there are several useful tips that may make your life easier.

As you can see, I use 3 extra flags, the –verbose flag, the –deep flag, and the –new flag. What do these do?

revdep-rebuild

Sometimes when you update your system, you update to newer versions of libraries.
so what happens to all the programs already installed and compiled to use libFlac.so.3 when you remove it and install libFlac.so.4?

well, they break sometimes. This is a common problem with using the -D flag when upgrading. how do you get around it? You run revdep-rebuild. revdep goes through a few phases- Collecting system binaries and libraries, Collecting complete LD_LIBRARY_PATH, Checking dynamic linking consistency, Assigning files to ebuilds, and emerging new packages.
Basically it checks all your binaries for the libraries they use, then check to see if the libs exist. if not, it determines which packages containt the binaries looking for the missing packages and recompiles them. I usually watch this process very carefully and stop it after it identifies which libraries are breaking binaries. a ctrl-c will break out of this, but you have to make sure you remove the temporary files in root’s home dir, ~/.revdep.*

This is a great way to find programs that slip through the cracks- for example, I’ve been using kde for a while now and recently upgraded my flac libraries. later, when I upgraded to kde 3.5, kde 3.4.3 was not removed. as I ran revdep-rebuild, it complained that kdemultimedia-3.4.3 was looking for the old version of flac. I ran
emerge -vp unmerge kdemultimedia
and sure enough it showed I had not only kde 3.4.3 and 3.5.0 installed, but 3.3.2 and 3.2.3 installed! I had left them in place “just incase” and each time forgot to remove the previous verson. I unmerged the old versions, removed the revdep temporary files and ran it again. everything was happy.

perl-cleaner and python-updater

These two programs piss me off to no end. Perl-cleaner serves many functions, but the main on is it reviews all the emerged-installed perl packages and re-emerges them. useful for when perl is updated, but a shame it’s not more automatic.

Python-updater needs to be run when you update python. What happens if you don’t? well, nothing that uses python will work for one. no warnings, no messages nothing- just a blip that scrolls by in the middle of a world upgrade. I found this gem in the gentoo forums after the cedega installer “point2play” broke for no apparent reason.

well I’m sure this list will get longer, but this is all you’re getting for now. I probably shouldn’t have ended on a down note, so think about puppies or something. good luck and enjoy gentoo.

UPDATE 20051220-

Something else I should have mentioned when talking about the use flags and the -N flag: if you ONLY want a single package to have a flag enabled, and the default action for the rest, rather than adding the flag to the USE variable in /etc/make.conf, you can add it to /etc/portage/package.use .
for example- suppose you only wanted bitchx to have the GTK flag. it WILL still requite all the gtk dependencies, but this way you don’t have to recompile openoffice, lame, mplayer, distcc, etc. to do this, you could add any of the following to /etc/portage/package.use:

net-irc/bitchx gtk
=net-irc/bitchx-1.1-r1 gtk
=net-irc/bitchx-1.1* gtk

each one has a different level of granularity. The first options covers all versions of the package. The second version is very specific: only that version. the third version is a hybrid- any subversion of 1.1- useful in case they find a security hole that needs to be patched but doesn’t warrant a new version.

There are actually several different files that can go in /etc/portage and provide similar functionality and syntax, but serve different purposes.
/etc/portage/package.use
/etc/portage/package.mask
/etc/portage/package.unmask
/etc/portage/package.keywords

besides use, keywords is the second most useful- it allows you to accept keywords for certaint packages, allowing you to mix stable and unstable packages. Here’s an example that is somehwhat outdated- when kde 3.4 came out, I was too impatient to wait for it to be given stable status in gentoo(stable for the x86 platform is “x86″, unstable is “~x86″), so I added the following lines for each package:
=kde-base/kdeedu-3.4.0 ~x86

and then when I went to emerge, the 3.4 version of the packages were available.

Topics: Linux, Open Source, Rant |

One Response to “Things every new Gentoo admin/user should know.”

  1. DrTebi Says:
    September 7th, 2007 at 8:27 pm

    python-updater is certainly something to get pissed off about. As if it isn’t enough pain that one has to update “emerge” almost every time that some security issued package has to be updated. No, now it even tells me it will need Python to be updated, BUT, it cannot do that because python-updater is blocking it. What the heck?

    # emerge -v python

    These are the packages that would be merged, in order:

    Calculating dependencies… done!
    [ebuild NS ] dev-lang/python-2.4.4-r4 USE=”berkdb gdbm ipv6 ncurses readline ssl -bootstrap -build -doc -examples -nocxx -nothreads -tk -ucs2″ 7,976 kB
    [ebuild N ] app-admin/python-updater-0.2 3 kB
    [blocks B ]

Comments