How To Properly Set Up Slackware Linux

This article began as a set of notes to myself. There were certain things I always did each time I installed Slackware. After years of revisions, including moving everything related to fonts into another page, it mostly turned into a set of miscellaneous tips. Anyway...

So you've done a full install of Slackware Linux. Now you've booted into it and a prompt blinks at you. Now what to you do? You make it perfect, that's what.

Here's how I do it.

Reading the Documentation

I'm assuming a certain level of Slackware knowledge. Anyone who has read the The Slackware Book understands enough to use Slackware and understand the rest of this guide.

In the root directory of Slackware's installation DVD are various documentation files. As is standard for Linux, these files are named with capital letters.

Log in as the root user, and you have an email from Slackware mainter Patrick Volkersding. It explains, among another things, Slackware's approach to package management.

As books on the use and administration of Slackware go, Slack Linux Basics is the next one to read. It's short, but very well-written and in-depth.

If you truly want to become an expert, consider reading the the rute book. It's free, and one of the best books available on administrating Linux. You can also buy a bound copy from any book retailer. I have a SlackBuild file (see the SlackBuild usage HOWTO) to install both the HTML and source versions in /usr/share/doc:

Understanding Packages

How Package Management Works In Slackware

Package management in Slackware is simple. The commands installpkg, removepkg and upgradepkg do what you think they'll do. These tools have a frontend, slackpkg, which automates many common tasks.

Installed packages are logged in “/var/log/packages”.

If you look in Slackware's /source tree, you will find source tarballs with .SlackBuild or, less commonly, .build files. The SlackBuilds are shell scripts for building the packages, while the .builds are for a package building program called slacktrack. This makes upgrading or rebuilding Slackware's packages very easy (just edit and rerun the SlackBuilds).

To use a SlackBuild, you make it executable and run it, as root, in the same directory as its corresponding source tarball. You may need to edit the SlackBuild first. SlackBuilds are written to make this easy, and the most commonly changed flags are stored in variables initialized at their beginnings. These include the following:

VERSION
the version of the source tarball
ARCH
the architecture to build for
NUMJOBS
the number of simultaneous compilations, which you should set to one more than the number of CPUs or cores

How To Get More Packages

The Old Way

In the past, most Slackware users built their packages from source, after downloading them from the package mantainers' websites. To build from source, you open up the tarball and read the provided instructions (particularly the README and INSTALL files). After building a few package, you realize the process is always the same:

  1. tar xf foo.tar.bz2
  2. cd foo
  3. ./configure --help
  4. ./configure plus any appropriate options from the last step
  5. make
  6. make install as root
  7. make clean
  8. cd ..
  9. mv foo /usr/local/src as root

When you want to uninstall it, you do the following:

  1. cd /usr/local/src/foo
  2. make uninstall as root

The New Ways

Nowadays, you rarely need to do this. Slacky and SlackBuilds.org are rich sources of unofficial packages. Gilbert Ashley's src2pkg (Linux.com article) has also emerged as a popular tool for building packages. sbopkg is an excellent frontend for the SlackBuilds.org repository.

Booting Faster

Optimizing LILO

Add a compact option to the top of lilo.conf to get a faster boot.

Optimizing rc.M

Comment out parts of “/etc/rc.M” you don't think you need. Good candidates are the fc-cache and ldconfig lines. One only needs to be run after installing a new font, the other after installing a new library; neither needs to be run every single boot.

I personally remove the update-icon-cache and update-mime-database blocks as well.

Setting the Framebuffer

Go to SlackBuilds.org and install lrmi. (Today, there isn't a SlackBuild for Slackware 13.0, but the SlackBuild for 12.2 works). As root, run the included vbetest utility.

It will print out a list of VESA video modes that you can set your Linux console to. For example:

VESA video mode number Resolution Colors
[352] 768x480 (256 color palette)
[353] 768x480 (5:6:6)
...
[360] [1280x800] (8:8:8)

Add up the numbers in the last column to get the number of bits used to represent colors, or the color depth. For example, the last mode above has 224 ≅ 16 million colors.

When you've picked a favorite (probably the one with the highest resolution and color depth), add 512 to the VESA mode number to get the Linux video mode. Set the vga= parameter in lilo.conf to the Linux video mode number. In this example, I would set vga=872.

Creating A New User

Now you'll create an account for yourself.

Each time you run adduser, when asked which additional group the new user account should belong to, say “cdrom, audio, video, scanner, plugdev, power, lp, netdev”. This will create a new user account with the privileges you need.

The above list of groups is for a user of Slackware 13.

Log in as that user.

Setting Up ALSA

This is the standard series of steps for setting up sound:

alsaconf
/etc/rc.d/rc.alsa start
alsamixer
alsactl store

When alsaconf asks for permission to modify modprobe conf, grant it. Your audio should be fully functional now.

Setting Up MIDI

First set up TiMidity++ with myTiMidity++ SlackBuild. You need it to get MIDI working in your web browser and in some games.

If you have a Creative Live card with wavetable support, then install Asfxload and use it.

If you don't, then TiMidity++ will be your MIDI port. You'll have to use aconnect to connect your Midi Through port to your Timidity port in order to get MIDI working in Wine. This uses a lot of CPU power, so make sure you disconnect the ports when you're done.

Setting Up X

The rest of this guide will assume that you've set up X. I'll leave that to you. One tip is that unless you need third party drivers (for your NVidia or ATI card, for example), then just try to start X before you try to set it up! As of Slackware 13.0, it should work out of the box. Another, for CRT monitors, is to use xvidtune to generate a modeline.

Configuring Your System to Boot into X

Edit “/etc/inittab” and change the default runlevel from 3 to 4.

That will change the default runlevel from 3 (console login) to 4 (graphical login). If you need to switch between runlevels, whether for testing purposes or to restart your graphical login manager, then use the telinit command; there's no need to reboot.

Adding A New Window Managers

You'll probably want to add a new window manager, such as my personal favorite, Icewm. After installing said window manager from source, add an entry for it in “/etc/X11/xinit” to get it to appear in xwmconfig.

As of Slackware 12.1, you'll need an appropriate .desktop file in “/usr/share/apps/kdm/sessions” to get it to appear in kdm's menus. Note, however, that kdm already has such support for every window manager under the sun, and thus no work should be necessary.

Playing DVDs and Video

Slackware comes with an excellent media player called xine. We can easily extend its capabilities. From the project page for MPlayer download an archive of Windows codecs. Extract it into “/usr/lib/win32/”. Xine reads that directory, so now it can use those codecs. Now xine can play almost anything. Symlink that directory to “/usr/lib/codecs” as well so MPlayer can use them.

Copy-protected DVDs need slightly more work. Simply download libdvdcss, install it, and then run ldconfig as you always do after installing a new library. If you launch xine now and ask it to play a CSS-encrypted DVD, it will.

Note that TV standards such as NTSC and PAL are designed for countries that use AC power. They split the TV image up into two alternating sets of horizontal lines, called fields, and display the even set, then the odd set, then the even set, and so on. NTSC countries use 60Hz AC and therefore NTSC switches between fields 60 times per second. Images on TVs look smooth only because they take time to fade; if you play TV signals on a computer monitor then it's normal to see the separation between the fields. You can solve this problem by deinterlacing the image and in xine, the key to turn this option on is “i”. Xine's default deinterlacing option simply throws away one field, and half your video quality, so do explore its menus for other options.

Making Firefox Perfect

Note: I've only tested this version with the 32-bit version of Slackware...

Just as in Windows, getting a web browser with full capabilities takes some work.

Start by installing the Linux versions of Adobe Reader, Flash Player and RealPlayer.

Install the libraries that MPlayer needs to handle streaming media. These would be either live555 or libnemesi. Rebuild (or build, if you're using Slackware < 13) MPlayer. Now install gnome-mplayer and gecko-mediaplayer. Disable gxine either by uninstalling it, or by removing the gxineplugin.* files from /usr/lib/mozilla/plugins.

Entering “about:plugins” in Firefox's address bar, and you should see that it will use gecko-mediaplayer.

Enter “about:config” into Firefox's address bar Create four keys to set up mms and rtsp streaming:

Preference Name Status Type Value
network.protocol-handler.app.mms user-set string /path/to/gnome-mplayer
network.protocol-handler.app.rtsp user-set string /path/to/realplay
network.protocol-handler.external.mms user-set boolean true
network.protocol-handler.external.rtsp user-set boolean true

You'll end up with a Firefox capable of playing all Flash movies and PDFs, not to mention every movie trailer on Apple - Movie Trailers (Quicktime, including HD) and Film.com (Realmedia), by spawning the appropriate players.

Windows Emulation

Besides the obvious steps of first installing Wine, then running winecfg to configure it and “wine iexplore http://www.winehq.org/“ to set up its Gecko engine, and there are a few more.

First, enable support for misc binaries. To do so, edit “/etc/rc.d/rc.modules” and uncomment the following line:

/sbin/modprobe binfmt_misc

Then add the following to “/etc/fstab”:

none /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0

Now add the following to “/etc/rc.rc.local”:

echo ':windows:M::MZ::/path/to/wine:' > /proc/sys/fs/binfmt_misc/register
echo ':windowsPE:M::PE::/path/to/wine:' > /proc/sys/fs/binfmt_misc/register

Now reboot.

Now, set any .exe file as executable, and it will execute with Wine. According to Wine Traffic #125, this is exactly how Wine is set up on Redhat and Mandrake.

You can set up other file associations like this as well. See File Associations in Linux to learn more.

Eye Candy

You've probably noticed that your GTK2-based programs look like Win95 unless they're running in Xfce. That's because Xfce use the xfsettingsd daemon (xfce-mcs-manager in Slackware < 13) to set the appearance of your GTK2-based apps to whatever you've specified using Xfce's control panel. When xfce-mcs-manager isn't running, the appearance of your GTK2 widgets remains at default.

So if you're running anything other than Xfce then have, as appropriate, your .xsession or .xinitrc or your window manager's startup file launch xfsettingsd.

If you don't want to run xfsettingsd, use another program to manage your GTK themes. LXAppearance is a good one.

GTK themes (and many other themes, such as xfwm themes) need to be installed into ~/.themes.

If you want to install a mouse cursor theme, put it in “~/.icons/default”, restart X, and enjoy it.

Put export OOO_FORCE_DESKTOP=gnome in /etc/profile to make OpenOffice.org look better.

Vim

The version of vim that comes with Slackware is compiled without X support. This is to accomodate users who don't run X. Unfortunately, this also means that if you do run X, you can't paste into vim from other X apps. Solve this problem by recompiling vim for X support (pass --with-x to its configure script). This is best done by downloading the entire vim source directory from a Slackware mirror, then editing and running the SlackBuild. After you do so, you'll be able to run the console version of vim inside an xterm, and paste text into it from other X applications.

Making Your Mouse More Sensitive

See linuX-gamers.net - Howtos - Increase USB Mouse Polling Interval.

If you have a USB mouse, you might be able to increase its polling interval. Create a file named usbhid in /etc/modprobe.d containing one line: options usbhid mousepoll=2.

After you reload the usbhid module and reconnect your mouse, try cat /sys/module/usbhid/parameters/mousepoll to see the polling rate that's currently active. It should be what you asked for.

You might not want to do this on a laptop, though, as it will increase your power consumption.

Rerunnning Setup

If you ever need to rerun setup—to enable or disable scripts, your time zone changes, whatever—just execute pkgtool as root.

Bluetooth Mouse

If you have a Bluetooth mouse, getting it working is as simple as editing rc.bluetooth.conf and changing HIDD_ENABLE=false to HIDD_ENABLE=true.

LAMP

Developing dynamic PHP websites is well-supported under Slackware. Setting up a LAMP server is simple.

(Don't do this if you're not actually developing or hosting PHP websites).

MySQL

Look in rc.mysqld for instructions on initializing MySQL.

Make rc.mysqld executable and start it up.

Apache

Make sure the following is active in /etc/httpd/httpd.conf:

# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf

Change the following:

#
# DirectoryIndex: sets the file that Apache will serve if a
# directory is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

To the following:

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

Set Apache up to read from home directories:

# User home directories
Include /etc/httpd/extra/httpd-userdir.conf

Reading httpd-userdir.conf tells you that it causes Apache to look in ~/public_html. So you can then develop your PHP programs in ~/public_html/.

Make rc.httpd exectuable and start it up.

Where To Go From Here

Yes, I know that that was a lot of work. But you didn't install Slackware expecting it to be easy; you installed it because you wanted the best, and that's what you now have.

If you have a very underpowered computer, or you want to really learn Linux, then you don't need to install X. The Unicode-enabled graphical framebuffer console you now have is amazingly capable. Use mplayer to play movies on it, and fbida to display graphics and pdfs. For heavy task switching and file management, there's screen and mc. And, of course, w3m is a text-based web browser that handles Unicode characters, Javascript and graphics. Console apps are renowned for their immense power. Their only drawback is that they aren't always trivial to set up or learn.

I personally use a text-based email system where getmail fetches my email from the server, then passes it to procmail, which passes it to spamassassin, which passes it back to procmail, which sorts it into various mailbox (mbox) files in my mail directory. This directory is read by an imap server called dovecot. I then lauch mutt, which is set up to connect to the dovecot imap server, and to read and manipulate my email there. Mutt spawns msmtp to send email through my ISP's SMTP server. This is the kind of power and flexibility you can expect if you're willing to work on the console level.

Or perhaps you have a very powerful state-of-the-art computer with a 3D card. Here's where things get fun. You should be running a window manager that fully supports 3D-accelerated transparencies and OpenGL shadows, such as Beryl. Enjoy native and emulated games such as Quake IV, Unreal Tournament 2004, Half Life 2, and World of Warcraft. If it's a desktop computer then drop in a pchdtv card and set it up as MythTV PVR capable of recording HD. Use Cinelerra to edit out the commercials, and either burn the shows you capture to DVD or encode them in x264 format to play on your iPod.

This is Slackware. Do anything you want.

Links

The Distribution

Communities

Handbooks

Post-Install Guides (like this one)

Software

Hints

Blogs and Zines

People