[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Upgrading Slackware to a New Release

I always use slackpkg (with care) to upgrade my Slackware systems from one stable release to the next. I call this process a “system upgrade”.
You can use the same procedure to migrate to slackware-current, keep a slackware-current system up to date, or upgrade from a slackware-not-so-current to a freshly released stable version.

Just running slackpkg and hoping for the best is not going to work. Some considerations have to be cared for. One important thing to remember:

Never upgrade your working kernel.

Why is that? Simple - you will be upgrading potentially hundreds of packages and should be prepared for the unlikely event that your computer does not work properly anymore after a system upgrade. One thing you don't want to get hit by is a system which does not boot at all. A new Slackware release may install a kernel that refuses to boot your computer (small chance but nevertheless… be prepared). For that reason, you need to keep your “old” working kernel installed, and keep a section for it in your /etc/lilo.conf file. That way, if the new kernel fails to boot, you can fall-back to the old kernel and start investigating what went wrong.
Basically, these are the same precautions you must take when you are compiling a new kernel yourself.

The following steps should work for all situations:

  • Blacklist the following kernel packages in “/etc/slackpkg/blacklist”:
    kernel-generic
    kernel-generic-smp
    kernel-huge
    kernel-huge-smp
    kernel-modules
    kernel-modules-smp

    This will prevent an accidental upgrade of your working kernel.

  • Blacklist packages from 3rd party repositories by adding appropriate lines for their repo tags. Examples for SlackBuilds.org, AlienBOB and multilib:
    [0-9]+_SBo
    [0-9]+alien
    [0-9]+compat32
  • If new kernel(s) have been added to the Slackware release you are upgrading to, then use “installpkg” to install those new kernel packages first (do not use “upgradepkg” because that will wipe your existing kernel).
    You will have to install at least one kernel (kernel-generic, kernel-generic-smp, kernel-huge, or kernel-huge-smp) and the corresponding kernel modules package (kernel-modules or kernel-modules-smp).
    You can not use slackpkg for this step.
  • Now that we have the new kernel(s) plus modules in place, we can start upgrading the rest of the packages. First, update the slackpkg package database:
    # slackpkg update
  • When slackpkg has updated its internal database we can let it update the computer to the new Slackware release:
    # slackpkg install-new
    # slackpkg upgrade-all
    # slackpkg clean-system
    • The first of those three commands (slackpkg install-new) will install every package which is marked in the Slackware ChangeLog.txt file with the string “Added.” This command will not install any other packages which are not yet installed.
      For instance if you did not have KDE installed before, the “slackpkg install-new” command will not add KDE packages to your computer all of a sudden.
    • The second command (slackpkg upgrade-all) will compare every official Slackware package which you currently have installed, with the package list on your Slackware mirror. If a different version is available, that version will be (downloaded and) upgraded. 1)
    • The third commmand (slackpkg clean-system) will show you an overview of all packages that you currently have installed and are not part of the Slackware Linux release you are upgrading to. This means, the list will show all packages which has been removed from Slackware. Examples for Slackware 14 are kdeaccessibility, kdebase, … Another example of such abandoned package in Slackware 14 is ntfsprogs. Actually this package was not removed but renamed… for Slackware that is equal to a package removal plus addition.
      The command will also show you every 3rd party package which you have installed! Use this command wisely: you must de-select every package which you want to keep (i.e. all 3rd party packages) and then click “OK” to let slackpkg remove all obsolete packages.
  • Finally, you can update your “/etc/lilo.conf” file with a section for the new kernel (don't remove your running kernel!). The “mkinitrd_command_generator.sh” script can help you finding the right block to append to /etc/lilo.conf. For instance, the command:
    # /usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz

    will result in the following output which you can copy/paste:

    # Linux bootable partition config begins
    # initrd created with 'mkinitrd -c -k 3.2.29 -f ext4 -r /dev/sdb2 -m usb-storage:pcmcia_core:pcmcia:mmc_core:ssb:modprobe:usbhid:ehci-hcd:ohci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz'
    image = /boot/vmlinuz-generic-3.2.29
      initrd = /boot/initrd.gz
      root = /dev/sdb2
      label = 3.2.29
      read-only
    # Linux bootable partition config ends

    Note that this command adds a “initrd” line to the kernel section. That line is not needed if you are going to run a “huge” kernel.

  • Remember to create a new initial ramdisk if you are going to use a generic kernel! If you are uncertain at this point how that must be accomplished, then you should make sure that you are booting a “huge” kernel which won't require an initial ramdisk.
    However, the “mkinitrd_command_generator.sh” script can help you with this as well. You may have spotted the correct mkinitrd command already in the output of the previous upgrade step…
    Run this script with the new kernel version as a parameter and it will show you an example “mkinitrd” command which will work for your particular hardware setup and system configuration:
    # /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.2.29

    will give this as output (the kernel version 3.2.29 is that of Slackware 14)

    #
    # mkinitrd_command_generator.sh revision 1.45
    #
    # This script will now make a recommendation about the command to use
    # in case you require an initrd image to boot a kernel that does not
    # have support for your storage or root filesystem built in
    # (such as the Slackware 'generic' kernels').
    # A suitable 'mkinitrd' command will be:
    
    mkinitrd -c -k 3.2.29 -f ext4 -r /dev/sdb2 -m usb-storage:pcmcia_core:pcmcia:mmc_core:ssb:modprobe:usbhid:ehci-hcd:ohci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
  • Finally, run the “lilo” command to make the change permanent and add the new kernel to the lilo boot menu.
    Remember, you should always be able to boot back into a previous kernel in case the new Slackware kernel gives you a hard time.
Bottom-line: you can trust slackpkg to perform a system upgrade safely, but it will need your brains and care.

Sources

1)
Slackware's package manager does not work with the concept of “lower version” and “higher version”. The package tools only look at “different version” and thus downgrading packages (reverting to an earlier version) is just as easy as upgrading to a newer version!
 howtos:systemupgrade ()