-->
Previous Table of Contents Next


Upgrading from a Previous Version of Linux

If you’re using an older version of Slackware and you want to upgrade to the version on the accompanying CD-ROMs, you can do so without going through the agony of a full installation.

The new versions of pkgtool (a package maintenance tool developed for the Slackware distribution) should provide a clean upgrade path from earlier versions of Slackware. Because pkgtool can now remove packages from your hard drive while running on a self-contained Linux filesystem loaded into a ramdisk, it can remove any files from your system, including ones, such as the shell, shared libraries, init, and other crucial system files, that were difficult or impossible to remove while running on the hard drive.


NOTE:  Upgrading through this method is probably more trouble than it’s worth. For example, several commonly reported bugs are caused by improper upgrading—mixing disks from different versions of the distribution and/or failing to remove old packages first. We need to face the fact that things haven’t quite settled down yet, and until they do it’s not always possible to foresee differences in filesystem structure, daemons, utilities, and so on that can lead to problems with the system.

The correct and best way to upgrade to a new distribution version is to back up everything you want saved and then reinstall from scratch. This is especially true for the A and N series disks. If you do upgrade packages from one of those disksets, you should seriously consider which packages from the other one might be related somehow and install those too. Again, it can be tricky to know just which packages are related, given the overall complexity of the Linux system. That’s why, unless you really know what you’re doing, there is a substantial risk of screwing up a system while attempting to upgrade it.


Here’s how you’d upgrade to a newer version of Slackware from any previous version that supports package information files in /var/adm/packages. (If your system puts these files elsewhere, you might still be able to do this by creating a symbolic link from the package information directory to /var/adm/packages.) The steps are as follows:

1.  Back up important files, or take your chances. Odds are you’ll come through OK. However, there are two important exceptions to this rule. The first (and most obvious) is when a package overwrites a file you meant to keep with a new one. The second, and possibly more serious, situation is when the system needs to replace an existing file with a symbolic link. It will replace the file, whether it’s a simple file, a file with a file permission of 444, or a directory filled with other subdirectories, each containing part of your doctoral dissertation. So, be careful.
2.  Make a list of the packages you plan to replace.
3.  Use a boot-kernel disk to boot one of the root/install disks. Log in as root.
4.  Mount your root Linux partitions under /mnt while logged into the install disk. The method used here differs, depending on what filesystem you’re using for Linux. For example, to mount an ext2fs partition, use

     mount /dev/hda1 /mnt -t ext2


Replace /dev/hda1 with the name of your root partition.
If you’re using UMSDOS (the system that allows you to install onto an existing MS-DOS filesystem), use this command:

     mount /dev/hda1 /mnt -t umsdos


If you’ve got other partitions that are part of your Linux filesystem, mount them after you’ve mounted that root partition. The method is the same; for example, here’s how you’d mount an ext2fs /usr partition:

     mount /dev/hda2 /mnt/usr -t ext2

5.  Once the partition has been mounted, you need to activate swap space if the system has less than 8 megabytes of RAM. (If you have 8 or more megabytes of RAM, you may go on to step 6.)
You may use either a swap partition or a swapfile. To get a quick listing of your partition information, you can always type fdisk -l. Doing this on a typical machine provides the following information:

Disk /dev/hda: 15 heads, 17 sectors, 1001 cylinders

Units = cylinders of 255 * 512 bytes



       Device Boot Begin  Start   End  Blocks   Id  System

    /dev/hda1         10     10    90   10327+   1  DOS 12-bit FAT

    /dev/hda2         91     91  1000  116025    5  Extended

    /dev/hda3   *      1      1     9    1139    a  OPUS

    /dev/hda5   *     91     91  1000  116016+   6  DOS 16-bit >=32M



Disk /dev/hdb: 16 heads, 31 sectors, 967 cylinders

Units = cylinders of 496 * 512 bytes

      Device Boot  Begin  Start   End  Blocks   Id  System

   /dev/hdb1   *       1      1   921  228392+   6  DOS 16-bit >=32M

   /dev/hdb2         922    922   966   11160   82  Linux swap


From this display, you can see that /dev/hdb2 has been designated as the Linux swap partition. If the partition has not been previously prepared with mkswap, here’s how that would be done:

     mkswap /dev/hdb2 11160


To activate the swap partition, you would type:

     swapon /dev/hdb2

6.  Remove the packages. To do this, type pkgtool and select the option Remove installed packages. You’ll be given a list of packages that you’ve installed—just select the packages that you plan to replace.
If you’re using one of the full-color versions of pkgtool, select the packages to remove by moving up and down through the list with + and - and selecting packages to remove with the Spacebar. Once you’ve selected all the packages you want to remove, hit Enter to remove them.
If you’re using one of the tty-based versions of pkgtool, you’ll have to type in the names of the packages you wish to remove. Separate each name with a space. Don’t worry about how long the line is—just keep typing in the names until you’ve entered them all, and then hit Enter to remove them.

That’s it! Now you’ve cleaned up the old packages and you’re ready to install the new ones. Type setup at a command line and install the new packages as normal.

Although it never hurts to play it safe and remove all packages from the bootdisk, almost all of them can be removed using pkgtool from your hard drive. The A series is the important exception here.


Previous Table of Contents Next