Sunday, June 12, 2011

Gentoo maintiance

After running Gentoo for years, if not always on my primary computer, I'd like to think that I've learned a thing or two about how to keep my system up to date. So here is a list of the commands/utilities that I use to keep my system running smoothly

emerge --update --deep --newuse world

(Repeat the last two commands until they both finish with nothing to do.)
lafilefixer --justfixit

(if obsolete packages are found remove or, more likely,
upgrade them and run revdep-rebuild and dispatch-conf again)
emerge -av --depclean (*** be careful with this one ***
It's suggestions on what to remove are sometimes dumb.)
eclean distfiles
emaint --check world
emaint --fix world

Many people have told me that doing an emerge --depclean can bork one's computer. But I've never had any trouble with it, until today. I wasn't paying enough attention, and it removed Python. A whole bunch of stuff is dependent on python, including emerge itself. So I had to unpack, configure and make python manually:

cd /tmp/
tar xjf /usr/portage/distfiles/Python-2.6.6.tar.bz2
cd Python-2.6.6/
./configure --with-fpectl --infodir=/usr/share/info --mandir=/usr/share/man
make install prefix=/usr

(You might have to fix the python symlinks in /usr/bin/; especially
if you are not installing the same version that was removed)
emerge python
rm -rf /tmp/Python-2.6.6
eselect python list
eselect python set 2

(On my system Python2.6.6 was first, and python 2.7.1 was second.)
rm /usr/bin/python2.6
rm /usr/bin/pydoc2.6
rm /usr/bin/2to3-2.6
rm -rf /usr/include/python2.6
rm /usr/lib/libpython2.6.a
rm -rf /usr/lib/python2.6
emerge --oneshot =dev-lang/python-2.6.6-r2

(Just to make sure I deleted all of the manually installed python.
If I missed anything it would result in a file collision)

Then I started my regular maintenance cycle above over again. The old Python 2.6.6 was removed, and everything continued to work because python-updater had switched all the python dependent programs over to Python 2.7.1

After going through all of this I realized that the problem was caused by upgrading from python version 2.6.6 to 2.7.1 - and not running python-updater afterward. All the programs that use python were still set to use version 2.6.6; while emerge --depclean saw that there was a new version and got rid of the old one. If I had realized, and run python-updater immediately after noticing the problem I might have been able to avoid all this. All though it was a fun adventure.

See how easy that was! Gentoo GNU/Linux is the best.

1 comment:

Josiah Luscher said...

perl-cleaner --all

Post a Comment