Share your knowledge at the LQ Wiki.
Go Back > Linux Answers > Applications / GUI / Multimedia
User Name


By manzdagratiano at 2011-05-26 11:46
This is the second time (the first was the 32-bit version, this time it was a replacement of that by 64-bit) I have succeeded in net-installing Slackware-current from inside another GNU/Linux distribution as a dual boot (well, actually a quintuple boot in my case), and I would like to share a consolidated version of that here, since no one place had all the information I used to that end. The ideas here stem from the following thread:

with thanks of course to Alien Bob and slac-in-the-box

The goal here is a little different from there, where the objective was to install Slackware inside a chroot. In fact, for a dual boot option, I would go so far as to recommend this method always over the traditional method - it is less hassle than with burning disks or writing to a USB drive. Also, for those of us who are lazy and blessed with a broadcom-wifi card, this is the only other alternative to Alien Bob's mini-iso.

I welcome any suggestions for improvements/enhancements.

I shall use Ubuntu/Debian as the host example (although this should, in principle, work for any), with Slackware-current as the target. Note that this requires the installation of Slackware's pkgtools inside Ubuntu/Debian, therefore I suspect that Arch Linux would not be a good place to do this because both Arch and Slackware share the 'makepkg' command, and Slackware's version may overwrite it. That being said, I see no reason why it cannot be overwritten and re-overwritten again.

The target partition was /dev/sda8. I shall be using the ext4 filesystem, and I have set up the system to share swap space with all the other distros. Also, as there need be only one grub on the system, I have not tried to create a separate boot partition.

Ergo, we begin thus:



Prepare the target partition:

$ mkfs.ext4 /dev/sda8
Mount it at the desired location
$ sudo mount /dev/sda8 /mnt
Grab hold of the pkgtools*.tgz package from a Slackware mirror, under the 'a' directory.

Convert this now to a .deb package, through the use of 'alien' (As of this writing, the latest release version of Slackware is 13.37):
$ sudo alien -i pkgtools-13.37-noarch-9.tgz
This command creates as .deb package as well as installs it.

Now we need to obtain a local slackware mirror. One can in principle write a script to retrieve packages while installing them, but it amounts to the same thing. Hence, in the Downloads folder, or any other folder, perform:
To create the entire mirror:

$ wget -m
with the `-m' option implying that we are creating a local mirror of the tree we have chosen.
Change to the directory with the tree (it would be convenient to cut and paste the lowermost directory `slackware64' into the current folder directly to avoid dealing with a huge depth).

It is usually more practical to just download each individual series one wants to install - for instance, kde and kdei may not be required.
The series I myself use to set up a fully functional system are:
a, ap, d, f, k, l, n, tcl, x, xap
and the downloaded packages may be further fine-tuned for a customized system, eg., remove the X input/video drivers that the system does not need.

$ mkdir slackware64
$ cd slakware 64
$ mkdir {a,ap,d,f,k,l,n,tcl,x,xap}
$ cd a
$ wget -r -np -nd
$ cd ../ap
$ wget -r -np -nd
and so on for each series.
The good thing about this also is that one may download two or more series in parallel from different mirrors, speeding up the retrieval process.

Then, commence the installation from the `slackware64' directory:
$ cd ..
$ sudo installpkg --root /mnt {a,ap,d,f,k,l,n,tcl,x,xap}/*.t?z

Now that the system has been installed, we may chroot to it:

$ sudo mount -t proc proc /mnt/proc
$ sudo mount -t sysfs sys /mnt/sys
$ sudo mount -o bind /dev /mnt/dev
and for network access:

$ sudo cp -L /etc/resolv.conf /mnt/etc
$ sudo chroot /mnt /bin/bash
Make system libraries available:

# ldconfig
The font cache may be updated as (if one wants to start X):

# fc-cache
Set the root password:

# passwd
Add a user for everyday use:
# adduser
and follow the prompts.

Add the user to the /etc/sudoers file:
# groupadd sudo
# usermod -a -G sudo <user>
# nano -w /etc/sudoers
and uncomment the line
%sudo ALL=(ALL) ALL
Change the hostname:

# nano -w /etc/HOSTNAME
Add the hostname alias to the line in /etc/hosts

Create fstab:

# nano -w /etc/fstab
A good start may be by copying over the host system's fstab and editing it accordingly.
Make sure that all the mount points defined therein are created on the system.

Select a slackware mirror:

# nano -w /etc/slackpkg/mirrors
The best option is to usually select a dynamic mirror, which keeps fetching packages/updates at top speed, eg.:

Update the slackpkg tree:

# slackpkg update
OPTIONAL: Install other tools from /extra, like jdk. `emacs' may also now be installed.

I usually like wicd over other interfaces, particularly because of its curses interface options, which I can use even from a TTY.

While inside the chroot, install wicd from the Slackware extras repository.

# slackpkg install wicd
Add the following to /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.wicd ]; then
/etc/rc.d/rc.wicd start
This allows wicd to start at boot.

Proprietary drivers like the broadcom-sta driver may be installed after reboot.

Do not forget to run:

$ sudo update-grub
on the host system - as there is no need for more than one bootloader on the system, there is no need for grub/lilo to be installed in Slackware.

Setting up X may be perfomed on the first boot of the OS, by running:

# xorgsetup

The first boot actually resulted in kernel panic, with an error:
not syncing: VFS: unable to mount root FS on unknown-block
This meant that the requred filesystem support was not present in the kernel, and a regeneration of initrd.gz was called for.
Therefore, I reverted back to the chroot and executed:

# mkinitrd -c -k <kernel-version> -m ext4 -f ext4 -r /dev/sda8
and all was well!

Note that `uname -r` will not work in a chrooted environment.
The kernel version may be found by looking at /lib/modules/


All times are GMT -5. The time now is 01:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration