Practical Exercises
To be completed due by 2/7/2008

  • Backup the original system configuration.
    Generate a list of installed packages on your desktop and store it in a file:
    cd /etc
    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.
    Use a Debian Etch 4.0 network install CD located by your desktop.

    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: /
    It is obvious to choose the nearest Debian mirror. In our case, it is a server in the Unisys lab. If you are at home and want to install Debian on your computer there, choose one of the official Debian mirrors.
    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, skip software installation and APT configuration. After reboot, you should be able to login into the new system as root.

  • Semi-automatic installation
    Download the preseed.cfg configuration file from http://linuxcourse.rutgers.edu/lessons/lesson2/preseed.cfg:
    wget http://linuxcourse.rutgers.edu/lessons/lesson2/preseed.cfg 
    
    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 debconf/priority=critical
    
    Accept the default language and time zone, then just wait until the installer finishes the installation. After reboot, 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, for example, you can not get the original desktop after you run startx; 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 into /etc and the other into /root:
    mkdir /floppy
    mount /dev/fd0 /floppy
    cp /floppy/old_system.tgz /etc
    cp /floppy/old_system.txt /root
    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:
    Open file /etc/apt/sources.list with an editor and leave there only the following two lines:
    deb http://192.168.5.55/ etch main contrib non-free
    deb http://security.debian.org/debian-security etch/updates main contrib non-free
    
    Run update for apt:
    apt-get update
    

    Copy file /root/old_system.txt into your current working directory. Generate a list of installed packages on your new system 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. You can use either the browser or command wget to fetch the file:
    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 415 packages as shown by
    wc -l diff.txt
    

    By using APT, install g++:
    apt-get install g++ 
    

    By using APT, install xfce4:
    apt-get install xfce4
    

    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
    

    Check the version of the Kernel installed
    uname -r
    
    As of 12/24/2007, there should be Kernel 2.6.18-5-686 coming with the installation of Debain Etch on your machines.
    Install the newest available version of the Kernel (2.6.18-6) by using APT:
    apt-get install linux-image-2.6.18-6-686
    

    Remove the old Kernel from the system:
    apt-get remove linux-image-2.6.18-5-686
    

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

    Previous Pageprevious
    First Pagetop