Upgrade Using Slapt-get
Introduction
See the Slapt-get page for an introduction to slapt-get and its functionality.
Prior to using slapt-get, you should really be familiar with proper usage of the native Slackware package management tools:
man pkgtool man installpkg man upgradepkg man removepkg
As indicated in the link above, slapt-get is *not* a replacement for those utilities - it *uses* those utilities. As such, any inherent "limitations" (yes, I use that term loosely) in the pkgtool suite will also apply to slapt-get.
Installation and Configuration
Get the slapt-get package for your version of Slackware.
Once it's installed, configure it to point to your favourite mirror (edit /etc/slapt-get/slaptgetrc)
# See /usr/doc/slapt-get-0.10.1/example.slapt-getrc # for example source entries and configuration hints. WORKINGDIR=/var/slapt-get EXCLUDE=^kernel-.*,^alsa-.*,^glibc.*,.*-[0-9]dl$,^devs$,^udev$,aaa_elflibs,x86_64 SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL
Usage Hints
Depending upon your individual goals of using slapt-get, the usage hints will vary. An individual wishing to upgrade from one release of Slackware to another will have more issues with which to contend than another individual who simply wants to keep up-to-date with official security/stability patches.
The biggest piece of advice I can give to *anyone* regardless of how/why you're using slapt-get is this: READ THE CHANGELOG! The pertinent portions of the changelog are also viewable for each package using --show option. You'll be okay most of the time if you ignore this advice, but don't come crying to ##slackware if you do... :)
From man slapt-get:
UPGRADE.TXT and ChangeLog.txt is still required reading, the latter is especially true when running -current.
By the way, don't even consider trying to follow the Slackware -current development using slapt-get; that's just *asking* for a problem (for reasons which will hopefully be clear later).
Official ChangeLog is at ftp://ftp.slackware.com/pub/slackware/slackware-12.2/ChangeLog.txt Replace the "12.2" with the release version you're using.
Rather than using the official ChangeLog (and Slackware.com bandwidth), it's better to use one of the official Slackware mirrors (you'll notice faster connections with the mirrors):
<SlackwareMirror>/slackware-<version>/ChangeLog.txt
See the Slackware site [[1]] to find an official mirror site.
Usage Hint #1: Security and Stability Patches
If your only goal is to stay up-to-date with official security and stability patches for your version of Slackware, then the default configuration of slapt-get should work fine for you. While I'm not the author of slapt-get (Jason, feel free to jump in here), it seems to me that this was the original intent of slapt-get (and it works *extremely* well for that task, might I add).
The only exception of which I can think is kernel upgrades; thankfully, those haven't happened *too* often in official releases in recent memory, but they do occur frequently enough to be worth considering. The default configuration of slapt-get will ignore kernel upgrades, so the only way you'll know about those is by reading the official ChangeLog. Anyway, every time you upgrade your kernel, you'll need to make sure the paths in /etc/lilo.conf point to a valid kernel, and then run /sbin/lilo to reinstall LILO. If you use some other boot loader, then I'm going to assume you know enough about its usage to perform the corresponding operation (if required) after upgrading your kernel.
I would recommend that you keep your old kernel around when installing a new one; it's always good to have a known-good kernel lying around just in case the new one doesn't boot. However, you'll notice that by default, running this command:
slapt-get --install kernel-$VERSION
will *upgrade* the kernel; in other words, it will *remove* the old kernel package and *install* the new one. This is not desirable if you wanted to keep your old kernel, so you can run this command instead:
slapt-get --install --no-upgrade kernel-$VERSION
From man slapt-get:
--no-upgrade Install the package rather than attempting to detect if a previous version is installed and upgrading it. This is useful for installing kernel packages. This option is only valid for --install targets.
You might also find this option useful for installing multiple versions of the alsa-* packages; if you're running both 2.4.x and 2.6.x kernels, you'll need the alsa-driver packages for both kernels, so an *upgrade* of the 2.4.x version to 2.6.x will remove the 2.4.x version.
Usage Hint #2: Upgrade From One Release To Another
Every Slackware release includes a file named UPGRADE.TXT - it was included for a reason, so READ IT! Once you are familiar with its contents, the rationale behind the information below will make more sense.
Step 1: Edit your /etc/slapt-get/slaptgetrc
Edit your /etc/slapt-get/slaptgetrc file to reflect the new Slackware version
This:
SOURCE=http://slackware.osuosl.org/slackware-12.1/ SOURCE=http://software.jaos.org/slackpacks/12.1/
becomes this:
SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL
Step 2: Download all updated packages
Download all updated packages to slapt-get's working directory; by default, this is /var/slapt-get
slapt-get --dist-upgrade --ignore-excludes --download-only
Step 3: Put your machine in single-user mode
Make sure you have already performed step 2, because the network will not be available in runlevel 1.
telinit 1
Step 4: Upgrade main packages
Versions >= 0.9.11 upgrade glibc-solibs, pkgtools, and sed first , and then upgrade the remainder of the packages. If you have read the UPGRADE.TXT file, you already know why this is needed. (hint, hint)
- Step 4a: If you are using slapt-get version earlier than 0.9.11, do:
slapt-get --install kernel --no-upgrade slapt-get --install glibc-solibs pkgtools sed slapt-get --dist-upgrade
- Step 4b: If you are using slapt-get version 0.9.11 or later, do:
slapt-get --install kernel --no-upgrade slapt-get --dist-upgrade --ignore-excludes
The --dist-upgrade option will prompt you to install all *new* packages in the ./a series, and you should say "yes" to ensure that you have a working system after the upgrade. See step 8 below for more information on installing new packages.
Step 5: Update LILO and config files
- Make sure the paths in /etc/lilo.conf point to a valid kernel image, and then run /sbin/lilo
- Fix your config files in /etc; the new ones are named with a *.new suffix. You should be able to use diff -u file file.new to show the differences between file and file.new. You'll have to decide whether to completely replace the old files with the new ones or merge your changes into the new ones first, but you *must* use the new files.
Step 6: Go back to multi-user mode
Sometimes the screen stays blank when you return to runlevel 3, and you might be worried that something went wrong. Before you panic, type clear and press Enter - you'll probably get your root prompt back :)
telinit 3
Step 7: Remove obsolete packages
There is an option to do this automatically with slapt-get:
slapt-get [--remove|--dist-upgrade] --remove-obsolete
From man slapt-get
--remove-obsolete Remove installed packages that are no longer available. This works for dist-upgrade only. This removes packages that are no longer available from any current package sources, but are currently installed. Be careful as this will also remove custom built packages.
As you see, this option will be fine if you don't have any custom-compiled packages installed (such as with checkinstall or using SlackBuild_Scripts). Read through the official ChangeLog to find all packages that were removed from Slackware during the development phase; you might be able use something like this to make the process go a bit more quickly:
grep -i removed ChangeLog.txt OR grep Removed ChangeLog.txt
Step 8: Add new packages
Similar to removing obsolete packages, there is an option to do this automatically with slapt-get using the --install-set option:
slapt-get --upgrade --install-set a ap d f k kde l n t tcl x xap y
From man slapt-get:
--install-set [disk set(s)] Install specified disk set(s). example: --install-set xap n l
This option will upgrade (or install, if not already installed) every package in every disk set. For reasons already detailed (kernel/alsa versions), this may not be desirable; additionally, if you don't have a full installation of Slackware for whatever reason, this will not be desirable.
The safest option is to read through the official ChangeLog.txt, make a note of new packages added during the release cycle, and install them now with this command:
slapt-get --install <newpackage1> <newpackage2> <...>
You might be able to use something like this to make the process go a bit more quickly, but it will return quite a few extraneous results.
grep -i added ChangeLog.txt
Step 9: Admire the Results :)
At this point, you should be running the latest version of Slackware.
Usage Hint #3: Keep Up With Slackware -current Development
After modifying your /etc/slapt-get/slaptgetrc
file to reflect -current sources, the most important advice you should hear is: READ THE CHANGELOG
Seriously, always read the ChangeLog.txt file associated with the -current tree; so long as you read it prior to running the slapt-get --upgrade
command, you should be familiar with any issues that might be encountered.
One idea you might consider is to use slapt-get as a "double checking" tool to ensure you haven't accidentally overlooked any packages. While the concerns detailed earlier in this article apply here (you won't be informed of any new packages added to -current), you can use the following lines to see if you missed anything that needed to be upgraded:
slapt-get --update slapt-get --upgrade --simulate