Practical Exercises
To be completed due by 2/1/2006

  • Backup the original system configuration.
    Generate a list of installed packages on your desktop and store it in a file:
    dpkg -l > old_system.txt 
    
    Archive some configuration files on your system:
    cd /etc
    tar -zcvf old_system.tgz hosts hostname resolv.conf X11 
    
    Get a blank floppy from the instructor or one of the TAs; format it with ext2 file system; mount it; copy the both created files onto the floppy:
    mke2fs /dev/fd0
    mkdir /floppy
    mount /dev/fd0 /floppy
    cp /etc/old_system.tgz /floppy
    cp /etc/old_system.txt /floppy
    umount /floppy
    
    Now you should be able to restore the original system configuration after Debian re-installation.

  • Manual system installation.
    Obtain a Debian Sarge 3.1 network install CD from the instructor or one of the TAs.

    Boot the system from the CD and follow the installer instructions. When prompted for the installation type, choose
    http
    Edit countries list by hand
    Enter information manually
    for host type in: 192.168.5.55; for directory: /debmirror. It is obvious to choose the nearest Debian mirror. In our case, it is a server in the Unisys lab. If you live on campus and want to install Debian on your computer in the dorm, choose debian.rutgers.edu.
    For partitioning, you can choose the following layout, or stay close to it:

      IDE1 master (hda)   
            #1 primary    256 MB     ext3       /
            #2 primary    512 MB     swap       swap
            #5 logical    512 MB     ext3       /var
            #6 logical    3.0 GB     ext3       /usr
            #7 logical    1.0 GB     ext3       /tmp
            #8 logical    leftover   ext3       /home
    

    In this exercise, you don't care about installing various software since the system is going to be reinstalled again in the next exercise. To save time, install only the base system. At the second installation stage after reboot, create root account, skip software installation and APT configuration. Now you should be able to login into the new system as root. proceed with "Finish configuring base system".

  • Semi-automatic installation
    Download the preseed.cfg configuration file from http://192.168.5.250/preseed/preseed.cfg:
    wget http://192.168.5.250/preseed/preseed.cfg 
    
    Edit the file and change the host name from unisys18 to that of the machine you are using in line:
    d-i  netcfg/get_hostname    string    unisys18
    
    Copy the file onto the the same floppy.
    mount /dev/fd0 /floppy
    cp preseed.cfg /floppy
    umount /floppy
    
    Boot the system from the CD. At the prompt, type the following boot parameters:
    linux preseed/file=/floppy/preseed.cfg languagechooser/language-name=English debconf/priority=critical
    
    Then just wait until the installer finishes the installation. At the second stage, after reboot, skip software installation and proceed with "Finish configuring base system". You should be able to login as root with password "r00tme", specified in the preseed.cfg. Change the root password upon the first login.

  • Restore the original configuration
    As you may have noticed, the newly installed system is not configured and lacks a lot of useful software, for example, you can not run startx since the XFree86 is not installed; the host name is the default, debian. Mount the floppy with the two files created in the first exercise and copy the one with the configuration archive:
    mkdir /floppy
    mount /dev/fd0 /floppy
    cp /floppy/old_system.tgz /etc
    cd /etc  	
    tar -zxvf old_system.tgz 
    
    Reboot the system. Now you see the host name shows as it was on the old system.

    Configure APT:
    apt-setup
    
    Choose edit sources list by hand. It will start nano editor. In the editor, write the following entries then exit with saving (Ctrl-X):
    deb http://192.168.5.55/debmirror sarge main contrib non-free
    deb http://security.debian.org/debian-security sarge/updates main contrib non-free
    
    Run update for apt:
    apt-get update
    

    Copy file old_system.txt from the floppy into your home directory. Generate a list of installed packages on your new ystem and store it in a file:
    dpkg -l > new_system.txt
    

    Comparing files new_system.txt and old_system.txt, you can see what packages have not been installed on the new system. To compare the content of the two files, download a script, make_update_list.sh. Since you don't have a browser at this moment, install wget and fetch the file with it:
    apt-get install wget
    wget http://linuxcourse.rutgers.edu/lessons/lesson2/make_update_list.sh
    
    Make the script executable and run as follows:
    chmod u+x make_update_list.sh
    ./make_update_list.sh old_system.txt new_system.txt 
    
    The script will generate a new file, diff.txt, which contains the list of the packages which were installed on the old system and are not installed on the new one -- about 130 packages as shown by
    wc -l diff.txt
    

    By using APT, install ssh:
    apt-get install ssh
    
    Similarly install the following packages:
    xserver-xfree86
    xfonts-base
    xbase-clients
    fvwm
    xterm
    xemacs21
    vim
    mozilla
    less
    gcc  g++  g77
    make  autoconf  autotools-dev  automake
    
    Again, check the number of the absent packages:
    dpkg -l > new_system.txt
    ./make_update_list.sh old_system.txt new_system.txt
    wc -l diff.txt
    

    Upgrade the kernel to 2.6. To check what the kernel the system is running, execute command
    uname -r
    
    Find the latest available kernel package for "686" kind of system:
    apt-cache search kernel-image-2.6 | grep 686
    
    As of now, the latest available kernel package is kernel-image-2.6.8-2-686. Run apt to install it:
    apt-get install kernel-image-2.6.8-2-686
    
    Reboot the system and verify that it boots into the new kernel:
    uname -r
    

  • Read about dpkg and APT:
    Sec. 24.2
    APT manual

    Previous Pageprevious
    First Pagetop