Projects - Installing Slackware
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.
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:
Since its first release in April of 1993, the Slackware Linux Project has aimed at producing the most "UNIX-like" Linux distribution out there. Slackware complies with the published Linux standards, such as the Linux File System Standard. We have always considered simplicity and stability paramount, and as a result Slackware has become one of the most popular, stable, and friendly distributions available.
Slackware takes a different approach than other popular distributions such as Red Hat, Debian, Gentoo, SuSE, and Mandriva in that it tries to be a "UNIX-like" Linux distribution. It has a policy of incorporating only stable releases of applications, and has a distinctive abscence of distribution-specific configuration tools found in other distributions of Linux.
Experienced Linux administrators find that the distribution is less buggy as it uses most packages in their pristine forms and without too many in-house enhancements which have a potential to introduce new bugs. Releases are infrequent (about once a year), although up-to-date packages are always available for download after the official release.
It offers no bells and whistles, sticking with a text-based installer and no graphical configuration tools. Where other distributions tried hard to develop easy-to-use front ends for many common utilities, Slackware offers no hand-holding and everything is still done through configuration files. Because of this, Slackware is only recommended to those novice users who intend to spend some time on learning about Linux.
Slackware is a fine distribution for those who are interested in deeper knowledge of Linux internals.
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.
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.
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.
After the preparation we will enter the stirring procedure£installation.In fact, it's very easy in the precondition of well preparation.
...... grub>kernel (hd0,0)/slkboot/bzImage root=/dev/hda1 ...... grub>initrd (hd0,0)/slkboot/initrd.img ...... grub>boot ......
setup to continue installing or type cfdisk to partition the hard disk manually if you did not do it before.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.
#groupadd zhy #cd /home #mkdir zhyfly #chmod 644 zhyfly #useradd -g zhy -p ****** -s /bin/bash zhyfly
sudo to give zhyfly execute commands as root (make sure select sudo package during installation):
#visudowill open /etc/sudoers and add one line:
zhyfly ALL=(ALL) NOPASSWD:ALL
/dev/hda4 swap swap defaults 0 0 /dev/hda3 / reiserfs defaults 1 1 /dev/hda1 /mnt/fatc vfat defaults,rw,users,dmask=000,fmask=0111,umask=000,codepage=936,iocharset=cp936 1 0 /dev/hda5 /mnt/fatd vfat defaults,rw,users,dmask=000,fmask=0111,umask=000,codepage=936,iocharset=cp936 1 0 /dev/hda6 /mnt/nte ntfs rw,users,umask=000,nls=cp936 1 0 /dev/hda7 /mnt/ntf ntfs rw,users,umask=000,nls=cp936 1 0 /dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0
... ... export LC_CTYPE=zh_CN G_BROKEN_FILENAMES=1
#!/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
startx using the new user, then:
[zhyfly@zhy2fly ~]$xorgconfigselect the approtiate option according to your own Hardware of your PC (including keyboard, mouse, monitor, video card, etc.).
Option "Protocol" "PS/2"to
Option "Protocol" "IMPS/2"and add the following line:
Option "ZAxisMapping" "4 5"
reboot and enjoy now!
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.).
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.