FlyZhy.Org logo Projects - Installing Slackware

Why Slackware
Before
HowTo
Download
Preparing
Installing
Configuring
After
References

Slackware1 is a Linux distribution created by Patrick Volkerding of Slackware Linux, Inc. I chose Slackware Linux now, therefore, you must want to know why slackware while why not other GNU/Linux distros? And how to install and configure it on my computer. OK, keep your eyes going on.

Why Slackware

I have used Redhat/Fedora GNU/Linux a couple of days, then Debian GNU/Linux a couple of months, and now Slackware Linux after the last time I touched Debian GNU/Linux. But why? Why Slackware and what attract me to insist on using Slackware? I have considered for a long time and got the reasons here:

Before

I have used two ways to install Slackware Linux which are CD installation and Hard Drive installation. Because the Hard Drive installation can contain and be more complicated than CD installation, I will show my Hard Drive installation based on Windows OS (fat32) only.

top

HowTo

Download

The latest version is Slackware 10.2 and also you can download all the files in the directory "slackware-current" to have the current version of Slackware. The mirrors I collected are:

Besides the ISOs (two) or files from "slackware-current" we still need another material named GRUB for DOS (grub020p) to boot up the slackware kernel.

Preparing

After downloading the ISOs (assume you use slackware 10.2):

Index of /data/slackware-10.2-iso/
Name Last Modified Size Type Parent Directory/ - Directory
slackware-10.2-install-d1.iso 2005-Sep-13 22:10:13 637.7M application/x-iso9660-image
slackware-10.2-install-d1.iso.asc 2005-Sep-14 21:04:18 0.1K text/plain
slackware-10.2-install-d1.iso.md5 2005-Sep-14 21:24:12 0.1K application/octet-stream
slackware-10.2-install-d2.iso 2005-Sep-13 22:10:56 645.2M application/x-iso9660-image
slackware-10.2-install-d2.iso.asc 2005-Sep-14 21:04:37 0.1K text/plain
slackware-10.2-install-d2.iso.md5 2005-Sep-14 21:24:34 0.1K application/octet-stream

you should check the two ISOs by their md5 file to make sure that they are usable2. Then extract the kernel files which are bzImage and initrd.img from kernels\bare.i\ and isolinux\ of the first ISO (slackware-10.2-install-d1.iso) respectively. At last, put all the files extracted from the two ISOs or all the files directed downloaded from the slackware-current directory of the mirrors into a directory (assume it's slack) of the fat323 partition of Windows OS. The files placed as follows:

c:\grub020p\
c:\grldr(extract from grub020p\)
c:\slkboot\bzImage
c:\slkboot\initrd.img
c:\slack\(the files extracted from slackware-10.1-install-d1.iso and slackware-10.1-install-d2.iso)

Notice: c partition is not the only option of the Hard Drive Partition to hold the installing files (for example you can replace all of c: with d: or e: etc. Also you can replace only c: of c:\slack\ with d: but remember the accurate path of them.).

The last step for preparation is to make grub usable when booting up the system. Just add one line into the file boot.ini in c:\4:

C:\GRLDR=Boot Grub

save the file boot.ini and quit.

Installing

After the preparation we will enter the stirring procedure£­installation.In fact, it's very easy in the precondition of well preparation.

  1. Reboot the system and press the "Boot Grub" option. Then type commands as follows5: Here you must learn some thing about the method to record the hard disk partition in GRUB that the (hd0,0) above stands for the first primary partition (mostly C:\ in Windows OS) of the first IDE controller port.
    ......
    grub>kernel (hd0,0)/slkboot/bzImage root=/dev/hda1
    ......
    grub>initrd (hd0,0)/slkboot/initrd.img
    ......
    grub>boot
    ......
    
  2. Use root as the default user to log in and type setup to continue installing or type cfdisk to partition the hard disk manually if you did not do it before.
  3. Then you will face a step-by-step installation process and pay attention to answer every question carefully.

Configuring

As far as I know, the installation of slackware is easy but the configuration to newbies is tough. Actually that's because this slackware newbie is also a Shell newbie. That is to say, if you are good at Shell programming, you will be also good at slackware because Slackware offers no hand-holding and everything is still done through configuration files. However, if you are really a newbie of Slackware and Shell, donot worry here but just follow.

  1. Add a new user and a new group for this user:
    #groupadd zhy
    #cd /home
    #mkdir zhyfly
    #chmod 644 zhyfly
    #useradd -g zhy -p ****** -s /bin/bash zhyfly
    
  2. Use sudo to give zhyfly execute commands as root (make sure select sudo package during installation):
    #visudo
    
    will open /etc/sudoers and add one line:
    zhyfly ALL=(ALL) NOPASSWD:ALL
    
  3. Configure the files in /etc/ as follows (refer to this according to your situation):
  4. Configure ~/.bashrc7:
    #!/bin/bash
    ### This should go in your ~/.bashrc file
    ### The end version for all uesrs (root or general users)
    ## Your system is $os which should be linux, bsd or unix
    case $(uname -s) in
       Linux) os=linux ;;
       *[Bb][Ss][Dd]) os=bsd ;;
       *) os=unix ;;
    esac
    # ANSI color definition
    # Attribute:
    # 0-off 1-bold(bright) 2-light(default) 4-underline 5-twinkle 7-reversal
    # ForeGround:
    # 30-black 31-red 32-green 33-yellow 34-blue 35-magenta 36-bluer 37-white
    # BackGround:
    # 40-black 41-red 42-green 43-yellow 44-blue 45-magenta 46-bluer 47-white
    # Format: \033[Attribute;ForeGround;BackGroundm
    # ie:
    # NORMAL="\[\033[0m\]"
    # BRIGHT_MAGENTA_RED="\[\033[1;35;41m\]"
    ## Define the bash prompt respectly by $UID
    if [ $UID -eq 0 ]; then
        # root (blue background with red foreground)
        # Format: [root]@[host][dir](last_command_return)#
        export PS1="\[\033[1;31;44m\][\u]@[\h]\[\033[1;31;44m\][\w](\$?)#\[\033[0m\]"
        umask=022
        export PATH="/usr/bin:/bin:/usr/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/usr/games:/opt/kde/bin:/opt/bin:/usr/share/texmf/bin:/usr/lib/jre1.5.0_04/bin:/usr/loca/share/openoffice.org2.0/program:/usr/local/matlab7/bin:$HOME/bin"
        alias rm="rm -i"
        alias cp="cp -i"
        alias mv="mv -i"
      else
        # general users (magenta background with yellow foreground)
        # Format: [user]@[host][dir](last_command_return)$
        export PS1="\[\033[1;33;45m\][\u]@[\h]\[\033[1;33;45m\][\w](\$?)\$\[\033[0m\]"
        export PATH="/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/games:/sbin:/usr/local/sbin:/usr/sbin:/opt/bin:/usr/share/texmf/bin:/usr/lib/jre1.5.0_04/bin:/usr/local/share/openoffice.org2.0/program:/usr/local/matlab7/bin:$HOME/bin:$HOME/bin/monsterz-0.6.1:$HOME/bin/nanoblogger-3.3-rc4"
        export CLASSPATH="$HOME/bin/kalman/kftool.zip"
        export MITSCHEME_6001_DIRECTORY="$HOME/program/mitscheme"
        export TEXINPUTS="$HOME/projects/TeX/dspum/images:";
        alias reboot="sudo reboot"
        alias halt="sudo halt"
        alias cat="sudo cat"
        alias gbk="sudo uniconctrl --gbk"
        alias mplayer="sudo mplayer"
        alias lftpmyweb="lftp haiyong:haiyong@211.64.130.238"
        alias nbuall="nb -u all && cp index.html index.htm && nb -P"
        alias nbu="nb -u && cp index.html index.htm && nb -P"
        alias jave="java -jar $HOME/bin/jave5/jave5.jar"
        alias kalmanfiltertool="java gui.KalmanFilterTool"
        alias schememit="scheme -large -band 6001.com -edit"
        CDROM="/mnt/cdrom"
        alias mcd='sudo mount -o loop $CDROM && cd $CDROM && ls'
        alias ucd='cd && sudo umount $CDROM && sudo eject && sleep 10 && sudo eject -t'
        alias ecd='sudo eject'
        alias ccd='sudo eject -t'
        DEVUSB="/dev/sda1"
        USB="/mnt/usb"
        alias musb='sudo mount -t vfat $DEVUSB $USB && cd $USB && ls'
        alias uusb='cd && sudo umount $USB'
    fi
    ## Tab Completion
    set show-all-if-ambiguous on
    set visible-stats on
    ## If this is an xterm set the title to user@host:dir
    case $TERM in
          xterm|rxvt-unicode)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'
        ;;
          *)
        ;;
    esac
    ## Configuration of locale and input(fcitx)
    export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/opt/lib/pkgconfig"
    export JAVA_HOME="/opt/java/jre"
    export LANG="en_US"
    export LC_CTYPE="zh_CN"
    export XDG_DATA_HOME="/opt/share"
    export XDG_DATA_DIRS="/opt/share"
    #export GTK_IM_MODULE=xim
    #export XMODIFIERS="@im=fcitx"
    #fcitx 2>&1 /dev/null
    ## Display ls-color according to your $os
    # --classify : executable files end with *
    #              directories end with /
    if [ "$os" = "linux" ]; then
        alias ls='/bin/ls --color=auto --classify'
       elif [ -x /usr/local/bin/ls ]; then
        alias ls='/usr/local/bin/ls --color=auto --classify'
       else
        alias ls='/bin/ls -F'
    fi
    ## Other aliases
    # ls
    alias ll="ls -l"
    alias la="ls -a"
    alias lla="ls -all"
    # ps
    case $os in
          linux)
        alias psa='ps axo "user,pid,ppid,%cpu,%mem,tty,stime,state,command"'
        ;;
          bsd)
        alias psa='ps axo "user,pid,ppid,%cpu,%mem,tty,start,state,command"'
        ;;
          unix)
        alias psa='ps -A -o "user,pid,ppid,ty,stime,s,comm"'
        ;;
    esac
    ### END
    
  5. Configure X, type startx using the new user, then:
    [zhyfly@zhy2fly ~]$xorgconfig
    
    select the approtiate option according to your own Hardware of your PC (including keyboard, mouse, monitor, video card, etc.).
  6. Configure three wheels mouse, modify the file /etc/X11/xorg.conf from:
    Option "Protocol" "PS/2"
    
    to
    Option "Protocol" "IMPS/2"
    
    and add the following line:
    Option "ZAxisMapping" "4 5"
    
  7. reboot and enjoy now!

    top

After

This is only the basic system for you to use now, look through other pages of WelcomePage to find more about my slackware stuffs (software, Chinese fonts, etc.).

top

References


1. Slackware® is a registered trademark of Slackware Linux, Inc.

2. Use WinMd5 software in Windows OS or md5sum command in GNU/Linux.

3. Although GNU/Linux kernel can recognize ntfs partition, here we strongly recommend fat32 partition.

4. Did you find it? If not, learn about how to find boot.ini.

5. Chinese users can refer to this file.

6. The symbol "+" stands for adding the following lines into the file in front of "+".

7. This is a file for all users (root or others) written by myself as ~/.bashrc.