Getting Started with Slackware: A Comprehensive Introduction

Okay, here’s a comprehensive article on getting started with Slackware Linux, aiming for around 5000 words:

Getting Started with Slackware: A Comprehensive Introduction

Slackware Linux holds a unique and revered position in the Linux world. It’s the oldest actively maintained Linux distribution, known for its stability, simplicity, and adherence to the “Unix philosophy” – doing one thing and doing it well. Unlike many modern distributions that strive for automatic configuration and hand-holding, Slackware embraces a more hands-on approach, giving the user complete control over their system. This control comes with a steeper learning curve, but the rewards are significant: a deep understanding of your operating system and a system tailored precisely to your needs.

This comprehensive guide will walk you through the process of getting started with Slackware, from downloading the installation media to configuring your system and installing software. We’ll cover the core concepts, the installation process, basic system administration, and common tasks. This guide assumes you have a basic understanding of the Linux command line, but we’ll explain commands and concepts as we go.

1. Why Choose Slackware?

Before diving into the installation, it’s worth considering why you might choose Slackware over other distributions. Here are some key reasons:

  • Stability: Slackware is renowned for its stability. It prioritizes well-tested and proven software packages, leading to a rock-solid system that’s less prone to crashes and unexpected behavior. Updates are released less frequently than “bleeding-edge” distributions, focusing on quality over quantity.
  • Simplicity: Slackware avoids unnecessary complexity. It uses a traditional init system (SysVinit, although systemd is also available), a straightforward package management system (pkgtools), and minimal automation. This simplicity makes the system easier to understand and troubleshoot.
  • Control: Slackware gives you complete control over your system. You choose exactly which packages to install, how to configure them, and how your system behaves. There are no hidden “magic” processes or forced updates.
  • Learning Opportunity: Working with Slackware is an excellent way to learn about the inner workings of a Linux system. You’ll be exposed to concepts and tools that are often abstracted away in other distributions.
  • Minimalism: Slackware installs a minimal base system. You build up your environment from there, adding only the software you need. This results in a lean and efficient system with minimal bloat.
  • Community: While smaller than some other distributions, the Slackware community is incredibly knowledgeable and helpful. The Slackware Documentation Project and online forums are excellent resources.
  • No Systemd by Default: Systemd is used in many major distros, however some users may not want to use it. Slackware’s default init system is SysVinit.
  • Rolling Release (Slackware-Current): Slackware’s development branch, -current, operates as a rolling release, providing the newest packages as they become available.

2. Obtaining Slackware

Slackware is available for download from the official website (slackware.com) and various mirrors. You have several options:

  • ISO Images: These are bootable images that can be written to a DVD or USB drive. There are separate ISOs for 32-bit (x86) and 64-bit (x86_64) systems. The full installation ISO contains all the packages, while the “mini” ISO is a smaller network installation image.
  • USB Images: Pre-made images designed to be written directly to a USB drive. These are convenient for modern systems that don’t have optical drives.
  • Torrent Files: Downloading via BitTorrent is often the fastest way to obtain Slackware, especially for the larger ISO images.
  • Network Installation: You can install Slackware over a network (e.g., FTP, HTTP, NFS) using a small boot image.

For this guide, we’ll assume you’re using the full 64-bit ISO image. Download the appropriate ISO and verify its integrity using the provided MD5 or SHA checksums. This ensures that the downloaded file hasn’t been corrupted.

3. Creating Bootable Media

Once you have the ISO image, you need to create bootable media.

  • USB Drive (Recommended):

    • Linux: Use the dd command (be very careful with this command, as it can overwrite data if used incorrectly). Replace /dev/sdX with the correct device name for your USB drive (use lsblk to identify it).
      bash
      sudo dd if=/path/to/slackware.iso of=/dev/sdX bs=4M status=progress
    • Windows: Use a tool like Rufus, Etcher, or Win32 Disk Imager to write the ISO to the USB drive. These tools provide a graphical interface and are generally safer than using dd on Windows.
  • DVD:

    • Linux: Use a burning tool like K3b, Brasero, or the command-line cdrecord or wodim.
    • Windows: Use the built-in Windows Disc Image Burner or a third-party tool like ImgBurn.

4. The Installation Process

Boot your computer from the USB drive or DVD. You may need to change the boot order in your BIOS/UEFI settings to prioritize the installation media.

4.1. Booting and Initial Setup

  1. Bootloader: You’ll be greeted by the Slackware bootloader (LILO or ELILO, depending on your system). You can usually just press Enter to boot the default kernel. If you need to pass specific kernel parameters, you can type them at the prompt.
  2. Keyboard Layout: If you need a keyboard layout other than US English, you’ll be prompted to select one.
  3. Login: Log in as root. There is no password by default during the installation.

4.2. Partitioning Your Disk

This is one of the most critical steps. Slackware provides cfdisk, fdisk, and parted for partitioning. cfdisk is generally the easiest for beginners, providing a text-based interface.

  1. Identify your disk: Use lsblk to list your block devices and identify the hard drive you want to install Slackware on (e.g., /dev/sda, /dev/nvme0n1).
  2. Launch cfdisk:
    bash
    cfdisk /dev/sda # Replace /dev/sda with your disk
  3. Create Partitions: You’ll need at least two partitions:

    • Root Partition (/): This is where the operating system files will be stored. A size of 20GB or more is recommended, depending on how much software you plan to install. The filesystem type should be ext4.
    • Swap Partition: This is used as virtual memory. A general rule of thumb is to create a swap partition that’s the same size as your RAM, or at least 2GB. The filesystem type should be swap.
    • (Optional) /home Partition: It’s highly recommended to create a separate partition for your user data. This makes it easier to reinstall the operating system without losing your files. The filesystem type should be ext4.
    • (Optional) EFI System Partition (ESP): If you’re using a UEFI-based system, you’ll likely already have an ESP (usually around 512MB, formatted as FAT32). You don’t need to create a new one; you’ll mount the existing one later. If you do need to create one (e.g., on a completely blank disk), create a partition of around 512MB and set its type to “EFI System”.
  4. Write the Partition Table: Once you’re satisfied with your partition layout, select the “Write” option in cfdisk to write the changes to the disk. Then select “Quit” to exit.

4.3. Setting Up Swap

Activate the swap partition:

bash
mkswap /dev/sda2 # Replace /dev/sda2 with your swap partition
swapon /dev/sda2

4.4. Running setup

The setup utility is Slackware’s main installation program. It guides you through the remaining steps.

bash
setup

4.5. setup Menu Options

  • HELP: Provides information about the installation process.
  • KEYMAP: Allows you to change your keyboard layout (you likely already did this).
  • ADDSWAP: Detects and activates swap partitions (you should have already done this manually).
  • TARGET: This is where you select the target partition(s) for installation.
    • Select your root partition (/).
    • Choose the filesystem type (ext4).
    • Choose whether to format the partition (yes, if it’s a new partition).
    • If you have a separate /home partition, select it and repeat the process.
    • If you have a pre-existing EFI System Partition, select it and choose “no” when asked to format it. You’ll be prompted to enter the mount point, which is /boot/efi.
  • SOURCE: Select the installation source (e.g., “Install from a Slackware CD or DVD”).
  • SELECT: Choose which software packages to install. Slackware organizes packages into series:

    • A: Base Linux system (essential).
    • AP: Various applications (e.g., text editors, utilities).
    • D: Development tools (compilers, libraries).
    • E: GNU Emacs.
    • F: FAQ lists and HOWTO documentation.
    • K: Kernel source.
    • KDE: KDE Plasma Desktop.
    • KDEI: Internationalization packages for KDE.
    • L: System libraries.
    • N: Networking tools and utilities.
    • T: TeX typesetting system.
    • TCL: Tcl/Tk/Expect scripting languages.
    • X: X Window System.
    • XAP: X applications.
    • XFCE: Xfce desktop environment.
    • Y: Games.

    You can select entire series or individual packages within each series. For a basic desktop system, you’ll likely want A, AP, L, N, X, and XAP. You can also choose KDE or XFCE if you want a graphical desktop environment. The “full” installation installs everything. It’s generally recommended to start with a smaller selection and add packages later as needed.
    * INSTALL: Begins the package installation process. This can take a while, depending on your hardware and the number of packages selected.
    * CONFIGURE: This section handles system configuration.

    • Modem Configuration: Configure your modem (if you have one).
    • Network Configuration: Configure your network interface(s). You can choose between:
      • NetworkManager: A modern network management tool (recommended for laptops and systems that frequently change networks).
      • Traditional rc.inet1 scripts: More manual configuration, but offers more control. If you choose this, you’ll need to edit /etc/rc.d/rc.inet1.conf to set your network settings (IP address, gateway, DNS servers).
    • Services: Select which services to start at boot. Common services include sshd (for remote access), cups (for printing), and httpd (for a web server).
    • Hardware Clock: Choose whether your hardware clock is set to UTC or local time. UTC is generally recommended.
    • Timezone: Select your timezone.
    • Default Window Manager: If you installed X, choose your default window manager (e.g., Xfce, KDE, or a simpler window manager like startx).
    • Font Configuration for X: Select a default font.
    • LILO/ELILO Configuration: Configure the bootloader.
      • LILO (for BIOS systems): You’ll typically want to install LILO to the Master Boot Record (MBR). The installer usually suggests a good default configuration. You can also add other operating systems to the LILO menu.
      • ELILO (for UEFI Systems): ELILO will be installed to the EFI System Partition.
  • EXIT: Exit the setup utility.

4.6. Setting the Root Password

After exiting setup, you must set a root password:

bash
passwd

Enter a strong password twice.

4.7. Creating a User Account

It’s best practice to create a regular user account for everyday use, rather than using the root account.

bash
adduser

Follow the prompts to create a user account. You’ll be asked for a username, user ID (UID), group ID (GID), home directory, shell, and password.

4.8. Rebooting

Once you’ve set the root password and created a user account, you can reboot your system:

bash
reboot

Remove the installation media when prompted.

5. Post-Installation Tasks

After rebooting, you’ll be greeted by the login prompt (either a text-based login or a graphical login if you installed a display manager like xdm, lightdm or sddm). Log in with your user account.

5.1. Updating the System

Slackware doesn’t have a traditional package manager like apt or yum. Instead, it uses pkgtools, a set of command-line utilities. The main tools are:

  • installpkg: Installs packages.
  • removepkg: Removes packages.
  • upgradepkg: Upgrades packages.
  • pkgtool: A menu-driven interface for managing packages.

However, to keep your system up-to-date, you’ll typically use slackpkg. slackpkg is a tool that automates the process of downloading and installing updates from a Slackware mirror.

  1. Configure slackpkg: Edit /etc/slackpkg/mirrors and uncomment (remove the # from) a mirror close to your location.
  2. Initialize slackpkg:
    bash
    slackpkg update gpg
    slackpkg update
  3. Install Updates:
    bash
    slackpkg install-new
    slackpkg upgrade-all

    The first command installs any new packages that have been added to the repository. The second command upgrades existing packages.
  4. Clean up:
    bash
    slackpkg clean-system

5.2. Installing Additional Software

You can install additional software using installpkg with .txz package files. However, a more convenient way is to use sbopkg, a tool that manages SlackBuilds.

  • SlackBuilds: SlackBuilds are scripts that automate the process of downloading, compiling, and packaging software for Slackware. They’re similar to AUR packages in Arch Linux. The SlackBuilds.org (SBo) website is the main repository for SlackBuilds.
  • sbopkg Installation: The sbopkg installation packages are available on the sbopkg website.

  • Install sbopkg: Download the sbopkg package from the SBo website and install it using installpkg.

  • Configure sbopkg: Run sbopkg and follow the prompts to configure it. You’ll need to synchronize the SlackBuilds repository.
  • Install Software: Use sbopkg -i <package_name> to search for and install packages. sbopkg will download the SlackBuild, build the package, and install it.

Example: Installing Firefox

bash
sbopkg -i firefox

5.3. Configuring the X Window System

If you installed X but didn’t choose a desktop environment during installation, you’ll need to configure X manually.

  1. Create an .xinitrc file: This file tells X what to run when you start it. Copy the default .xinitrc file to your home directory:
    bash
    cp /etc/X11/xinit/xinitrc ~/.xinitrc
  2. Edit .xinitrc: Edit the .xinitrc file to start your desired window manager or desktop environment. For example, to start twm (a very basic window manager):

    exec twm

    Or, to start startxfce4 (if you installed Xfce):
    exec startxfce4
    3. Start X: Type startx to start the X Window System.

5.4. Setting up Networking (if using rc.inet1)

If you chose to use the traditional rc.inet1 scripts for networking (instead of NetworkManager), you’ll need to edit /etc/rc.d/rc.inet1.conf.

Here’s a basic example for a static IP configuration:

“`

Config information for eth0:

IPADDR[0]=”192.168.1.100″ # Your IP address
NETMASK[0]=”255.255.255.0″ # Your netmask
USE_DHCP[0]=””
DHCP_HOSTNAME[0]=””

Default gateway IP address:

GATEWAY=”192.168.1.1″ # Your gateway address

Nameserver(s) (DNS):

NAMESERVER=”8.8.8.8″ # Google Public DNS
NAMESERVER=”8.8.4.4″
“`

Change the values to match your network settings. Then, restart the network service:

bash
/etc/rc.d/rc.inet1 restart

For a DHCP configuration, set USE_DHCP[0]="yes" and leave IPADDR, NETMASK, and GATEWAY blank.

5.5. User Management

  • Adding users: adduser
  • Deleting users: userdel
  • Modifying user accounts: usermod
  • Changing passwords: passwd <username>
  • Adding users to groups: usermod -aG <group> <username> (e.g., usermod -aG wheel username to add a user to the wheel group, which often has sudo privileges).

5.6. Sudo Configuration (Optional)

To allow regular users to run commands with root privileges, you can configure sudo.

  1. Install sudo: If it’s not already installed, use installpkg or sbopkg to install it.
  2. Edit the sudoers file: Use the visudo command to edit the sudoers file. Never edit this file directly with a text editor; visudo performs syntax checks to prevent errors.
  3. Add a user or group: Add a line to allow a specific user or group to use sudo. For example, to allow all members of the wheel group to use sudo:

    %wheel ALL=(ALL) ALL

6. System Administration Basics

  • System Logs: Most system logs are located in /var/log. Important logs include:
    • /var/log/messages: General system messages.
    • /var/log/syslog: System log messages.
    • /var/log/dmesg: Kernel ring buffer messages (useful for hardware issues).
    • /var/log/Xorg.0.log: X server log.
  • Process Management:
    • ps aux: List all running processes.
    • top: Display a dynamic real-time view of running processes.
    • kill <PID>: Terminate a process (use kill -9 <PID> to force termination).
    • pkill <process_name>: Kill processes by name.
  • File System Navigation:
    • cd: Change directory.
    • ls: List files and directories.
    • pwd: Print working directory.
    • mkdir: Create a directory.
    • rmdir: Remove an empty directory.
    • rm: Remove files or directories (use with caution!).
    • cp: Copy files or directories.
    • mv: Move or rename files or directories.
    • find: Search for files.
    • grep: Search for text within files.
  • Text Editors:
    • nano: A simple, beginner-friendly text editor.
    • vi/vim: Powerful, modal text editors (steeper learning curve).
    • emacs: Another powerful, extensible text editor.
  • System Information:
    • uname -a: Display kernel information.
    • lsb_release -a: Display distribution information (not very informative on Slackware).
    • free -h: Display memory usage.
    • df -h: Display disk space usage.
    • du -sh <directory>: Display disk usage of a directory.
  • Shutdown/Reboot:
    • shutdown -h now : Shutdown immediately.
    • shutdown -r now : Reboot immediately.
    • reboot : Reboot
    • poweroff: Poweroff.

7. Slackware Package Management (pkgtools) – Deeper Dive

While slackpkg and sbopkg handle most package management needs, understanding the underlying pkgtools is beneficial.

  • Package Format: Slackware packages are compressed tarballs with a .txz extension (older packages might use .tgz). They contain the files to be installed and a slack-desc file with package information.
  • installpkg:
    bash
    installpkg package.txz

    Installs a package. It automatically handles dependencies if the dependent packages are present in the same directory. It does not automatically fetch dependencies from the internet.
  • removepkg:
    bash
    removepkg package

    Removes a package.
  • upgradepkg:
    bash
    upgradepkg oldpackage.txz newpackage.txz

    Upgrades a package. It removes the old version and installs the new one.
  • pkgtool: A text-based menu-driven interface that provides options for installing, removing, and viewing packages.

8. Using SlackBuilds and sbopkg – Deeper Dive

sbopkg is the preferred way to install software not included in the official Slackware repositories.

  • sbopkg Commands:
    • sbopkg -r: Synchronize the SlackBuilds repository.
    • sbopkg -s <package_name>: Search for a package.
    • sbopkg -i <package_name>: Install a package (builds it from source).
    • sbopkg -u: Upgrade installed SlackBuilds.
    • sbopkg -g <package_name>: Get information about a package.
    • sbopkg -b <package_name>: Build a package without installing it.
    • sbopkg -d <package_name>: Download a SlackBuild and its dependencies without building.
  • Queues sbopkg uses a queuing system that allows multiple packages to be installed, removed, or updated in sequence.

9. Troubleshooting

  • Check Logs: The /var/log directory is your first stop for troubleshooting.
  • Kernel Messages: Use dmesg to view kernel messages, which can reveal hardware issues.
  • Search Online: The Slackware Documentation Project, the LinuxQuestions.org forums, and the official Slackware forums are excellent resources.
  • Ask for Help: Don’t be afraid to ask for help in the Slackware community. Provide detailed information about your problem, including error messages and steps you’ve already taken.

10. Beyond the Basics

This guide has covered the fundamentals of getting started with Slackware. Here are some areas you might explore further:

  • Desktop Environments: Experiment with different desktop environments (KDE, Xfce, GNOME, etc.) or window managers (Openbox, i3, Awesome, etc.).
  • Shell Scripting: Learn Bash scripting to automate tasks and customize your system.
  • System Configuration Files: Familiarize yourself with the configuration files in /etc.
  • Kernel Compilation: Learn how to compile your own kernel for maximum customization and performance.
  • Security Hardening: Implement security best practices to protect your system.
  • Networking: Explore advanced networking concepts like firewalls, routing, and VPNs.
  • Virtualization: Use VirtualBox or KVM to run other operating systems within Slackware.
  • Slackware-Current: Use the development branch of Slackware as a rolling-release distro.
  • AlienBOB’s Restricted Repositories: These are useful unofficial repositories which have restricted software.

Conclusion

Slackware Linux is a powerful and rewarding operating system. While it requires more effort to set up and maintain than some other distributions, the knowledge and control you gain are invaluable. This guide has provided a comprehensive introduction to the installation, configuration, and basic usage of Slackware. By embracing the Slackware philosophy of simplicity and control, you’ll gain a deeper understanding of Linux and build a system that’s truly your own. Remember to consult the official documentation and the Slackware community for further assistance. Happy Slacking!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top