Home > linux, slackware, upgrade > New Slackware!

New Slackware!

Finally, new Slackware! 14.2 has been released. Time to upgrade. Since I started using Slackware in 2010 I’ve always used an official method described in UPGRADE.txt and never had any problems with that. This year, however, I decided to give slackpkg method a try, especially because I also use Slackware at work now and and don’t want any downtime and if I strictly followed an official way I’d have to switch to a single-user mode for a longer while. Whole procedure turned out to be very simple and reliable and basically comes down to what is said here. I’ll just leave it here so I won’t have to look for it when the new Slackware is released.

  1. First, replace 14.1 with 14.2 in the mirror you already use in /etc/slackpkg/mirrors. For example, I use this mirror:

    ftp://mirrors.slackware.com:/slackware/slackware64-14.1/

    And now I changed it to:

    ftp://mirrors.slackware.com:/slackware/slackware64-14.2/

    Don’t forget the terminating ‚/‘, it must be there.

  2. Update list of available packages for 14.2:
    $ slackpkg update
    
  3. Upgrade slackpkg itself:
    $ slackpkg upgrade slackpkg
    

    When asked what to do with new config files:

    • /etc/slackpkg/mirrors.new – you can either remove it (R) as we already chose a valid mirror for 14.2 in step 1 or overwrite it (O) and select a mirror again before proceeding to a next step.
    • /etc/slackpkg/blacklist.new – we are going to use it later. If you have never modified /etc/slackpkg/blacklist by hand just tell slackpkg to overwrite it. Otherwise, see what changes have been introduced and decide what’s the best for you. Note that /etc/slackpkg/blacklist has changed in slackpkg 2.82.1.
  4. After upgrading slackpkg, update list of available packages again:
    $ slackpkg update
    
  5. Now that we have a new slackpg and /etc/slackpkg/blacklist and a package list we are going to add packages that should be upgraded outside of slackpkg to the slackpkg blacklist list. The most important package that should be blacklisted is kernel. The point is that we don’t want slackpkg to remove our running kernel and end up with an unbootable system in case a new kernel didn’t work on our hardware. Of course it’s always possible to let slackpkg replace the kernel and manually restore a last working official kernel later using a Live CD/USB in case of any problems but it would just be more difficult and time-consuming.

    You should also consider blacklisting all packages that you upgraded outside of Slackware official channel because otherwise slackpkg will replace it with whatever it downloads without looking at the version number so it can effectively downgrade the packages. For example, I use latest-firefox.sh script to get the newest version of Firefox instead of relying on an ESR version of Firefox included in stock Slackware and for this reason I also added mozilla-firefox-* to the list of blacklisted packages.

    At the end of the day my /etc/slackpkg/blacklist is:

    # This is a blacklist file. Any packages listed here won't be
    # upgraded, removed, or installed by slackpkg.
    #
    # The correct syntax is:
    #
    # To blacklist the package xorg-server-1.6.3-x86_64-1 the line will be:
    # xorg-server
    #
    # DON'T put any space(s) before or after the package name or regexp.
    # If you do this, the blacklist will NOT work.
    
    #
    # Automated upgrade of kernel packages aren't a good idea (and you need to
    # run "lilo" after upgrade). If you think the same, uncomment the lines
    # below
    #
    kernel-firmware
    kernel-generic
    kernel-generic-smp
    kernel-headers
    kernel-huge
    kernel-huge-smp
    kernel-modules
    kernel-modules-smp
    kernel-source
    
    #
    # aaa_elflibs should NOT be blacklisted!
    #
    
    # You can blacklist using regular expressions.
    #
    # Don't use *full* regex here, because all of the following
    # will be checked for the regex: series, name, version, arch,
    # build and fullname.
    #
    # This one will blacklist all SBo packages:
    #[0-9]+_SBo
    mozilla-firefox-*
    
  6. Now we’re ready to install all new additions to Slackware and upgrade existing packages, it’s the most time-consuming part of the upgrade process, it took more than an hour on my machine. Do:
    slackpkg upgrade glibc-solibs
    slackpkg install-new
    slackpkg upgrade-all
    

    Watch especially for startup scripts that have been modified such as /etc/inittab or /etc/rc.d/rc.4. All changes can be undone if you have a backup of old configuration files but it takes time.

    Now you should see cat /etc/slackware-version is already saying:

    Slackware 14.2
    
  7. Now we are going to remove all packages that are no longer part of Slackware base. Before doing that it’s a good idea to blacklist all packages you have installed outside of slackpkg, for example manually or via slackbuilds.org or you will have to skip them manually. For example, I uncommented the following entry in /etc/slackpkg/blacklist to blacklist all packages from slackbuilds.org:
    [0-9]+_SBo
    

    Now do this:

    $ slackpkg clean-system
    

    If you’re not sure whether a given package has been installed by you or came with previous Slackware release check if it’s listed as removed in CHANGES_AND_HINTS.TXT.

  8. Finally, we are going to upgrade kernel. First, comment back ‚kernel-*‘ entries in /etc/slackpkg/blacklist we uncommented in step 5 and download new kernel packages:
    $ slackpkg download kernel
    

    Install them manually:

    $ installpkg /var/cache/packages/slackware64/a/kernel*txz
    

    Now you should have 2 kernels in /boot:

    $ ls -Alhtr /boot/vmlinuz*
    -rw-r--r-- 1 root root 3.3M Feb 14  2014 /boot/vmlinuz-generic-3.10.17
    -rw-r--r-- 1 root root 6.2M Feb 14  2014 /boot/vmlinuz-huge-3.10.17
    -rw-r--r-- 1 root root 4.2M Jun 24 10:31 /boot/vmlinuz-generic-4.4.14
    -rw-r--r-- 1 root root 7.3M Jun 24 10:38 /boot/vmlinuz-huge-4.4.14
    lrwxrwxrwx 1 root root   22 Aug 19 21:18 /boot/vmlinuz-generic -> vmlinuz-generic-4.4.14
    lrwxrwxrwx 1 root root   19 Aug 19 21:18 /boot/vmlinuz-huge -> vmlinuz-huge-4.4.14
    lrwxrwxrwx 1 root root   19 Aug 19 21:18 /boot/vmlinuz -> vmlinuz-huge-4.4.14
    

    Note that /boot/vmlinuz which was previously pointing to vmlinuz-huge-3.10.17 is now pointing to a new kernel.

    In your /etc/lilo.conf you already something like have this:

    image = /boot/vmlinuz
      root = /dev/sda1
      label = Linux
      read-only
    

    That means that if you rebooted your machine now lilo would start a new kernel. But as said previously, we want to find a quick way to use an old kernel in new one didn’t work properly. To do that, we need to temporarily restore an old entry and give it an uniqe name, for example:

    image = /boot/vmlinuz-huge-3.10.17
      root = /dev/sda1
      label = old
      read-only
    

    Add the above entry to your /etc/lilo.conf, run `lilo‘ to write changes, reboot and when LILO screen shows up choose `Linux‘ as usual. If system booted successfully, `uname‘ should show you’re running kernel 4.4.14:

    $ uname -r
    4.4.14
    

    If system didn’t boot successfully you can reboot and go back to an old kernel by choosing `old‘ entry in lilo menu and take some time to figure out what doesn’t work with a new kernel.

    When you’re ready you can safely remove 3.10.17 kernel packages:

    $ find  /var/log/packages/kernel*3*  | rev | cut -d / -f1 | rev | xargs slackpkg remove
    

    And you can also remove `old‘ LILO entry from /etc/lilo.conf, we won’t need it any more.

That’s it – you’re now running a new version of Slackware.

Now, you will notice that some packages installed from slackbuilds.org or generally outside of Slackware mainline won’t start anymore with errors such as:

ristretto: error while loading shared libraries: libxfce4util.so.6: cannot open shared object file: No such file or directory

It is caused by the fact that these packages are linked against old libraries which are no longer present on the system. To fix the problem recompile a given package on an updated system.

Kategorienlinux, slackware, upgrade Tags:
  1. Bisher keine Kommentare