Hello friends!

Today is 2016/08/25, 25 years of Linux! Happy Birthday!! :D :D

Today we gonna talk about how to upgrade a Slackware, we will use just the official slackware package management tool (slackpkg), lets upgrade a slackware 14.2 to a -current for example (this also works with other versions too, but try upgrade to the next always or deal with consequences).

What is slackpkg?

Slackpkg is a system package management tool developed by PiterPunk and oficially supported by Slackware, some of the most common subcommands are:

    slackpkg update          -> synchronize with your mirror 
    slackpkg search package  -> looks for 'package' into mirror
    slackpkg install package -> install 'package' from mirror
    slackpkg upgrade package -> upgrade 'package' from mirror
    slackpkg upgrade-all     -> upgrade all packages installed
    slackpkg install-new     -> install new software available in repository

First, install and upgrade your slackpkg

# slackpkg update  #(choose a mirror in /etc/slackpkg/mirrors)
# slackpkg upgrade slackpkg

I like the TDS Mirror but you can choice any -current mirror you like there. Then add the kernel packages into blacklist (/etc/slackpkg/blacklist) make sure that looks like this:

#kernel-firmware
#kernel-generic
#kernel-generic-smp
#kernel-headers
#kernel-huge
#kernel-huge-smp
#kernel-modules
#kernel-modules-smp
#kernel-source
(this is not totally necessary but I like to upgrade kernels after upgrade all other softwares)

Second, then upgrade your glibc-solibs, this is EXTREMELY NECESSARY to not crash your system after some upgrades of software.

# slackpkg upgrade glibc-solibs

Third, install and upgrade all your new software

# slackpkg install-new
# slackpkg upgrade-all

Kernel

Now, if you dont build your kernel youself, uncomment lines of blacklist (/etc/slackpkg/blacklist) to build the new kernel of Slackware repository. Check your lilo.conf or grub and apply the new kernel if you like (take care here, confirm that a new kernel was installed and check the images)

# cp /boot/vmlinuz /boot/vmlinuz-backup
# sed -i '/#kernel/s/^#//g' /etc/slackpkg/blacklist
# slackpkg upgrade-all 
# vim /etc/lilo.conf

The huge.s Slackware default kernel (built-in) have a lot of issues when we need use some softwares that require some modules/built-in by default, an example is the Docker. (huge.s default slackware kernel doesn’t support Docker very good). So you can choose use the generic kernel that has almost any module to load after boot the kernel, solving some of these issues. If you choose to do that, type the commands below, if you dont know what are you doing skip this part and use default /boot/vmlinuz.

# /usr/share/mkinitrd/mkinitrd_command_generator.sh
mkinitrd -c -k 4.4.16 -f ext4 -r /dev/sda1 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:ext4 -u -o /boot/initrd.gz
(this will generate this command to build a initrd.gz image, run this)
(it also, of course, creates '/boot/initrd.gz' with your def modules)
# vim /etc/lilo.conf # or your grub. i dont use this
(put your initrd image here and choice a vmlinuz-generic as default image)

Your lilo.conf should now look like this (tip: create another entry with old kernel, so if this fail to boot you can boot with the older)

image = /boot/vmlinuz-generic  # re-check if you use vmlinuz
 root = /dev/sda1              # change if not your root disk
 initrd = /boot/initrd.gz
 label = Slack64-Generic
 read-only
image = /boot/vmlinuz-backup
 root = /dev/sda1
 label = Slack64-Okay
 read-only

Then save your MBR and reboot your system!

# lilo -v  (check this with attention)
# reboot

And welcome to the -current version of Slackware, keep it upgraded :)