I've been tooling around on ##slackware on freenode the past few days and I've
noticed a general distrust for automated upgrade tools for Slackware Linux.
There are a hand full of such tools but the one that I use is
swaret. Two others are
slapt-get
and
slackpkg.
Like I said, I only use swaret so I can't say much about the others.
Anyway, while just watching the conversations someone mentioned to just install
qt with
swaret --install qt in response to a question and another
person said something to the effect of "Are you insane?" and went on to say he
isn't responsible for the guy hosing his box because "swaret tends to do that".
This is far from the first time I've heard such talk and while I understand and
respect the policy of ##slackware to not support anything other than the
pkgtool I just don't agree with the blanket statement of tools tending to hose
systems. The reason I say this is I've been using swaret for several months
without a single problem and I think that's not because swaret is the end all
be all of tools for slackware but more because I use the tool in a sensible
way. In my mind, to blame swaret alone for hosing a system is much like
blaming the hammer for breaking your hand when you don't know how to use a
hammer in the first place. Just blinding running
any upgrade tool
without some sane precautions is just asking for trouble, regardless of the
tool or the distribution it's being run on.
So, here is how I've used swaret without problems. First, grab at least version
1.7.0test4 of swaret because it supports rollback. Everything from this point
on is based on this version, hopefully it won't change much in future versions. Once
you download it install using
installpkg in the normal way. Then
edit
/etc/swaret.conf and edit the file to your liking. It's well
commented so I won't repeat most of it. Be sure to enable rollback by having
ROLLBACK=1 and add
EXCLUDE=aaa_elflibs* to the
excludes section. Based on the changelog it's a bad idea to ever upgrade
aaa_elflibs. One other change I did that isn't 100% needed is to set
DSEARCHM=1 so that swaret uses slocate instead of find to search
for missing libraries. Just make sure updatedb is run often. Since updatedb
is run as a cron job every night by default this shouldn't be a problem. As for
the rest of the conf file, just read the commends and go with personal
preference for the rest.
That's it for the technical part of it. The rest of how I use swaret is just
simply (un)common sense. I run
swaret --update
followed by
swaret --list -u every once in a while to see if
anything new is available. If it is I don't upgrade right away. This is where
I think most people mess up. First I go read the
Slackware
Changelog and see if there are any notes regarding the upgrades. Then I do a
complete system backup. I have big external USB drive that I use
partimage in
Knoppix to store a complete
image of my system on just before I upgrade anything potentially dangerous like
gcc or glibc. If what I'm upgrading isn't terribly dangerous I just backup
/etc, /home, /usr/src, and any other data that's important to me. Once I'm
backed up and only then do I actually run
swaret --upgrade which
downloads the updates, backs up the existing installed packages in
/var/swaret/rollback, then upgrades the packages using upgradepkg.
Swaret just uses the pkgtools (installpkg, removepkg, upgradepkg) to do
it's work so it's simply using the standard tools in a script for you. Once
its done upgrading I like to reboot and check my dmesg and /var/log/messages
for any oddness.
If something is wrong that I can't fix I now have a full system backup and the
rollback of swaret to use if needed. Now, I've never had to actually use the
rollback feature directly. I've only had 1 or 2 problems that were solved by
rolling back an individual package using
upgradepkg
oldpackagename%newpackagename. As an example, a recent upgrade of udev
in slackware-current was bad, so I just rolled back udev like so
upgradepkg
udev-054-i486-1%udev-050-i486-1.tgz. As I understand it swaret keeps a
certain number of upgrades in rollback, I think three by default. From what
I've read you would just need to run
swaret --rollback # where the
# is equal to the number of the rollback you want to revert to. Failing any of
this though I have the full disk image from partimage that I can restore my
entire system from.
The entire point of this is that swaret and anything else like it is just a
tool. Applying a little common sense and taking time to do things right
instead of blindly upgrading is all that's
needed to make these tools work. To not be careful like this is just asking
for trouble.