Dugan Chen's Homepage

Various Things

How To Properly Set Up Slackware Linux

Preamble

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.

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, Slackware 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

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

Getting Packages

The Old Way

In the past, most Slackware users built their packages from source, after downloading them from the package maintainers’ 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:

  • cd /usr/local/src/foo
  • 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.

Slackware maintainers Eric “Alien Bob” Hameleers and Robby Workman also maintain high-quality repositories.

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 thefc-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 Console Video Mode

If you’re lucky, your video card might support a VESA video mode in your monitor’s native resolution. That will allow you to use a framebuffer in that resolution.

Go to SlackBuilds.org and install hwinfo. Then enter the following as root:

hwinfo --framebuffer

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

Mode 0x0361: 1280x800 (+5120), 24 bits

The important parts are self explanatory: the mode number, which starts with 0x, the width and height, and the number of colors.

If I have a 1280×800 monitor and I like the mode above, I would edit lilo.conf and change the vga setting to 0x0361.

If you don’t see a mode appropriate for your monitor, then just set vga=normal. It’s faster.

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 my TiMidity++ 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

Choosing A Media Player

For a media player, Alien Bob’s patent-encumbered version of the VLC media player will serve most people best. Go get it. Use it, Enjoy it.

Playing Streaming Media

Want to set up VLC to play RTSP streaming media in Firefox? Start Firefox. Enterabout:config into the address bar. Create a new boolean key with the name ofnetwork.protocol-handler.expose.rtsp and the value of false. Then click on the RTSP link you want to play. The “choose a program to handle this protocol” window will pop up. Choose VLC.

This is covered in the Mozillazine Knowledgebase’ Register protocol page.

Dealing With Interlacing

If you see horizontal lines in your video, then read on:

Interlaced 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 interlaced TVs look smooth only because they take time to fade; if you play interlaced 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. The options are in VLC’s menus.

There are many resources about this, and Xiph’s Digital Media Primer for Geeks is currently the most entertaining.

Windows Emulation

Get a wine and wine-gecko package from Alien Bob. The x86 Wine package is for the 32-bit version of Slackware, and the x86-64 package is for the 64-bit version with a multilib subsystem set up.

If you have a 64-bit multilib system and you’d prefer to build Wine yourself, then consider building a shared Wow64 setup that can run both 64-bit and 32-bit binaries.

Besides the obvious steps of first installing Wine, then running winecfg to configure it and “wine iexplore http://www.winehq.org/“ to initialize 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 xfsettingsd 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.

Making Your Mouse More Sensitive

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

options usbhid mousepoll=2

After you reload the usbhid module and reconnect your mouse, try to see the polling rate that’s currently active:

cat /sys/module/usbhid/parameters/mousepoll

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.

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. Carry them out.

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 executable and start it up.

Flash

There are some things you should know about Flash.

First, you should know where to get it. The current best version is the in-development “square” preview, which works well on both 64-bit and 32-bit systems. You can download packages, and scripts to build those packages, from Alien Bob.

Second, you should be aware that Flash’s GPU acceleration stops working if you use a compositing window manager such as Compiz.

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 today’s text browsers, can handle 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 used to 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.

If you’re running a state-of-the-art computer with a 3D card and you’re booting straight into X, then no recommendations are necessary.

This is Slackware. Do anything you want.

Links

The Distribution

Communities

Handbooks

Post-Install Guides (like this one)

Software

Hints

Blogs and Zines

People