13 Feb 2007 - 18:42:33 - DannyDeCockYou are here: Godot's Twiki >  Main Web > InstallingUbuntuTOC

Installing Ubuntu

  • I recently started experimenting with Ubuntu. It is a very decent candidate to check out if you experienced lots of problems with knoppix... It provides what it claims: an out-of-the-box working environment that is very complete...
  • Once the thing has been installed to your machine, you might wish to visit the excellent ubuntu starter guide

Installing the base installation

  • Download an Ubuntu CD, e.g., from http://www.ubuntulinux.org/download/
  • Boot from the CD, and press the enter key whenever appropriate smile
    The defaults proposed during the installation are very sensible... The installer also allows you to resize an existing ntfs partition without destroying all its content. Just do the following when the Partitioning disks screen appears:
    1. Choose the Manually edit partition table option
    2. Choose the NTFS partition you want to resize
    3. Choose the Size: line
    4. Choose Yes when asked to Write changes to disk and resize the partition?
    5. Enter the new size (the installer will not like it if you reduce the partition to less than half its original size)
    6. Wait until the (time consuming) resizing process completes...
  • Once the installation procedure has finished (this will take about 20 minutes), you can immediately log in (once the machine has rebooted and finished the installation (another 15 minutes)), and will have a decently configured machine... If you are a gnome user, you will not have to update much...
  • You can now log in as the user you defined during the installation procedure
  • Make sure your /etc/apt/sources.list contains useful links to ubuntu packages if you have not yet done so (cfr. http://www.esat.kuleuven.ac.be/~decockd/configs/ubuntu.apt.sources.list). You can also use the nice package management tool synaptic for that purpose:
    1. # start synaptic:
      sudo synaptic
      
      

    2. # it will show you an introduction screen... Press Close to get rid of it smile
    3. # once the main window is shown, you can alter the content of /etc/apt/sources.list: click Settings -> Repositories
    4. # you will get an overview of the package repositories that are currently known to your system... It is safe to remove the CD Ubuntu... repository, as it would require your Ubuntu CD to be permanently present when manipulating packages: click CD Ubuntu..., and click the Remove button
    5. # I typically remove all the original repositories (repeat the procedure you followed to remove the Ubuntu CD... for each of the original repostitories), and then add all available repositories: click the Add button, and mark all the components: Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (multiverse), and confirm your selection pressing the OK button.
    6. # Repeat this add procedure for each repository type: Ubuntu Hoary Hedgehog, Ubuntu Security Updates and for Ubuntu Updates
    7. # Once done, you should confirm these modifications by clicking OK
    8. # Accept to reload the package list from the servers...
  • # If you are an icewm user (like me), you should first install icewm before you feel comfortable... smile
    Installing icewm is not that straightforward:
    • Once you get the ubuntu login window, just press ctrl-alt-f1 to go to a text console
    • Login using the userid and password you supplied during the installation procedure
    • Initialize your providers of available ubuntu packages, e.g., using the following list: (the sudo password is the same as the login password you supplied): You can download a decent version of /etc/apt/sources.list at http://www.esat.kuleuven.ac.be/~decockd/configs/ubuntu.apt.sources.list
      deb http://security.ubuntu.com/ubuntu/ hoary-security main restricted universe multiverse
      deb http://archive.ubuntu.com/ubuntu/ hoary-updates main restricted universe multiverse
      deb http://archive.ubuntu.com/ubuntu/ hoary main restricted universe multiverse
      
      

    • Install icewm:
      sudo apt-get -y install icewm
      
      

    • Once these packages have been installed, you can resume to login with X: go back to the X window (press ctrl-alt-f7), restart the X server (press ctrl-alt-backspace)
    • As soon as the login screen comes back, you can select the "sessions" section, select "icewm", and accept to make it your default window manager

Automatically mounting your filesystems/partitions

Add all available partitions to /etc/fstab and mount them under, e.g., /part/hda1, /part/hde1,...

A typical /etc/fstab looks like
/dev/hda1 /part/hda1 ntfs defaults,auto,umask=000 0 0
/dev/hda3 /part/hda3 ext3 defaults,auto 0 0

I simply execute the following script to make it look like the above:

sudo su -
for partition in `fdisk -l -u|grep ^/dev/|grep -v swap|grep -v Extended|cut -d ' ' -f-1`;do
        mountpoint=`echo $partition|sed s/dev/part/`
        mkdir -p $mountpoint
        if [ :`fdisk -l|grep -i $partition|grep -i ntfs|wc -l`: == :1: ];then
                fstype=ntfs
                specialoption=",umask=000"
        else if [ :`fdisk -l|grep -i $partition|grep -i fat|wc -l`: == :1: ];then
                fstype=vfat
                specialoption=",umask=000"
        else if [ :`fdisk -l|grep -i $partition|grep -i "83  linux"|wc -l`: == :1: ];then
                fstype=ext3
                specialoption=""
        else
         fstype=auto
           specialoption=""
        fi;fi;fi
        cp -a /etc/fstab /etc/fstab.tmp
        grep -v ^$partition /etc/fstab > /etc/fstab.tmp
        echo adding $partition as $mountpoint to /etc/fstab, $fstype
        echo $partition $mountpoint $fstype defaults,auto$specialoption 0 0 >> /etc/fstab.tmp
        mv -b /etc/fstab.tmp /etc/fstab
        done
mount -a
exit

Note that the umask=000 which is added to the default mount options for ntfs partitions makes the partition accessible by non-root users...


Finetuning support for your hardware

Making your machine connect to a hidden wireless access point

  • Make sure you set the mac address of your hidden wireless access point and the corresponding wep key (remember to substitute the mac address and the web key you see below for your own values smile ):
    sudo apt-get install -y kwifimanager
    kwifimanager &
    
    

    Once you installed and executed the kwifimanager, you can start configuring your wireless card:

    sudo su -
    ESSID=yourEssID
    WEBKEY=12345678901234567890123456
    WIRELESSINTERFACE=`iwconfig |cut -d ' ' -f1|head -1`
    if [ :$WIRELESSINTERFACE: == :: ];then WIRELESSINTERFACE=ath0;fi
    
    if [ :`grep $ESSID /etc/network/interfaces|wc -l`: == :0: ];then
      echo >> /etc/network/interfaces;
      echo \# wireless network interface >> /etc/network/interfaces;
      echo iface $WIRELESSINTERFACE inet dhcp >> /etc/network/interfaces;
      echo \#wireless-essid $ESSID >> /etc/network/interfaces;
      echo \#wireless-key $WEBKEY >> /etc/network/interfaces;
      echo \#auto $WIRELESSINTERFACE >> /etc/network/interfaces;
    fi;
    /etc/init.d/networking restart
    exit
    
    

  • Once you have set these values, you can restart the network interfaces, and the hidden access point should be discovered: kwifimanager will report the status smile

Load a few interesting modules (ide/scsi, ide/compact flash,...)

sudo su -
for module in ide-scsi ide-cs;do
  if grep $module /etc/modules;then
    echo /etc/modules already contains the $module module...
  else
    echo $module >> /etc/modules
    modprobe $module
  fi
done

Making your machine tuxracer-enabled if it comes with an ati radeon video card

If the benchmarking tool glxgears indicates less than 600 frames per second, you will not be able to enjoy the productivity tool tuxracer to its full extend smile The following steps increase the glxgears rating to over 1300 on a hp compaq nw8000 laptop...
sudo apt-get install -y xorg-driver-fglrx xorg-driver-fglrx-dev fglrx-control fglrx-kernel-source tuxracer
sudo su -
for module in fglrx agpgart;do
  if grep $module /etc/modules;then
    echo /etc/modules already contains the $module module...
  else
    echo $module >> /etc/modules
    modprobe $module
  fi
done

# replace the ati driver line:
sudo perl -pi -e 's/Driver.*ati/Driver \"fglrx\"\nOption \"UseInternalAGPGART\" \"no/' /etc/X11/xorg.conf

# extend the module section as follows:
sudo perl -pi -e 's/Section \"Module\"/Section \"Module\"\nSubsection \"extmod\"\nOption \"omit xfree86-dga\"\nEndSubSection/' /etc/X11/xorg.conf

# restart X with ctrl-alt-backspace, login, and check whether tuxracer behaves nicely smile

Making the modem work (for an hp compaq nw8000)

  • Make sure you can compile things with your machine:
    sudo apt-get install -y gcc module-assistant sl-modem-source linux-headers-`uname -r`
    sudo module-assistant build sl-modem-source
    sudo module-assistant install sl-modem
    
    

  • Load the appropriate modules and daemon:
    sudo apt-get -y install sl-modem-daemon
    sudo /etc/init.d/sl-modem-daemon restart
    
    

  • Configure your dialling software:
    sudo su -
    wvdialconf /etc/wvdial.conf
    exit
    
    

  • Edit /etc/wvdial.conf to include your dialin userid, password and phone number with your preferred editor:
    sudo joe /etc/wvdial.conf
    
    

  • Once all these parameters have been set, you can dial in with:
    sudo wvdial
    
    


Installing acroread for ubuntu

# The following instructions download and compile the current (latest) version of pine:
INSTDIR=/tmp/acroread
mkdir -p $INSTDIR
cd $INSTDIR
wget http://master.grad.hr/~ivoks/ubuntu/acroread/mozilla-acroread_7.0-0.9ubuntu1_i386.deb
wget http://master.grad.hr/~ivoks/ubuntu/acroread/acroread_7.0-0.9ubuntu1_i386.deb
wget http://master.grad.hr/~ivoks/ubuntu/acroread/acroread-plugins_7.0-0.9ubuntu1_i386.deb
sudo dpkg -i *acroread*deb


Compiling the current version of pine

# The following instructions download and compile the current (i.e., latest) version of pine:
sudo apt-get install libncurses5-dev libssl-dev;
PINEDIR=/tmp/pine;
mkdir -p $PINEDIR;
cd $PINEDIR;
wget ftp://ftp.cac.washington.edu/pine/pine.tar.gz;
#wget ftp://ftp.cac.washington.edu/pine/old/pine4.58.tar.Z
tar -xzvf pine*tar.*;
cd *;
./build slx  SSLDIR=/usr/lib/ssl SSLINCLUDE=/usr/include/openssl
sudo cp -a bin/pine /usr/bin/
sudo chmod a+rx /usr/bin/pine
sudo chown root.root /usr/bin/pine


installing skype

INSTDIR=/tmp/skype
mkdir -p $INSTDIR
cd $INSTDIR
wget http://www.skype.com/go/getskype-linux-deb
sudo dpkg -i skype*.deb


Finetuning the icewm toolbar

  • I like to have a few browser buttons in the toolbar:
mkdir ~/.icewm
echo prog \"XTerm\" \"xterm\" xterm -ls > ~/.icewm/toolbar
echo prog \"Firefox\" \"mozilla-firefox\" firefox >> ~/.icewm/toolbar
echo prog \"Mozilla\" \"mozilla\" mozilla >> ~/.icewm/toolbar


Finetuning the joe editor

  • I get slightly irritated when pasting backquotes in joe. This is because joe interprets the backquote as a special command to start entering character codes in hex, decimal, or octal notation... Very irritating... smile I solve this by redefining the backquote:

sed "s/quote\t\t\`/quote\t\t^K \`/" /etc/joe/joerc > ~/.joerc


Installing a java virtual machine (j2se)

Once finished, you can install it:

sudo mkdir -p /usr/local/java
chmod a+x ~/Desktop/j2sdk-1*bin
# make sure to install j2se and netbeans into /usr/local/java
sudo ~/Desktop/j2sdk-1*bin

Once finished, you can start the netbeans integrated development environment with:

/usr/local/java/netbeans*/bin/netbeans

Add the java binaries to your default path:

echo >> ~/.bash_profile
for a in /usr/local/java/*/bin;do
  echo export PATH='$PATH':$a >> ~/.bash_profile
  done

Installing the java documentation may also be helpful smile You can visit http://java.sun.com/j2se/1.4.2/download.html#docs. Once you downloaded the documentations zip file, you can install it:

ZIPFILE=~/Desktop/j2sdk*doc.zip
DOCDIR=/usr/local/java/`basename $ZIPFILE|cut -d '-' -f-2`
sudo mkdir -p $DOCDIR
cd $DOCDIR
sudo unzip $ZIPFILE

Install the eclipse integrated development environment

sudo mkdir -p /usr/local/java
cd /usr/local/java
sudo tar -xzvf ~/Desktop/eclipse-SDK-*-linux-gtk.zip

Add eclipse to your default path:

echo >> ~/.bash_profile
echo export PATH='$PATH':/usr/local/java/eclipse >> ~/.bash_profile


# Interesting applications and utilities

# Dictionaries

sudo apt-get install -y dict dict-bouvier dict-de-en dict-devil dict-easton dict-elements dict-foldoc dict-freedict-eng-fra dict-freedict-eng-lat dict-freedict-eng-nld dict-freedict-fra-eng dict-freedict-fra-nld dict-freedict-lat-eng dict-freedict-nld-eng dict-freedict-nld-fra dict-gazetteer dict-gazetteer2k dict-gazetteer2k-counties dict-gazetteer2k-places dict-gazetteer2k-zips dict-gcide dict-hitchcock dict-jargon dict-moby-thesaurus dict-vera dict-web1913 dict-wn trans-de-en

# Spelling checkers

sudo apt-get install -y diction iamerican ibritish idutch ifrench ingerman ispell

# Document creation utilities

sudo apt-get -y install kile chktex

# Document viewers and converters

sudo apt-get -y install latex2html gv html2ps 

# Source code and text formatters

sudo apt-get -y install astyle groff

# Mathematics and Calculators

sudo apt-get -y install apcalc pari-gp pari-doc 

# Browsers

sudo apt-get install mozilla-browser opera

# Essential utilities smile

sudo apt-get install -y   ascii bsdgames ccal fortunes fortunes-bofh-excuses fortunes-debian-hints fortunes-off fortunes-spam miscfiles wamerican wamerican-large wamerican-small wbritish wbritish-large wbritish-small wdutch wenglish xlockmore-gl xautolock

# Perl programming

sudo apt-get -y install perl-doc 

# Popular editors

sudo apt-get install vim emacs21 vim-doc joe 

# Charts creation utilities

sudo apt-get -y install xfig gnuplot 

# Graphics conversion and viewer utilities

sudo apt-get -y install imagemagick 

# Text search utilities

sudo apt-get install -y agrep recode

# Text comparing utilities

sudo apt-get install -y wdiff

# System utilities

sudo apt-get install -y timeout and numlockx mc

# Network utilities

sudo apt-get install -y traceroute kwifimanager netdiag ssh curl links

# Hardware discovery tools

sudo apt-get install -y usbview 

# Network sniffers & wep key discovery tools

# Have a look at http://wepattack.sourceforge.net/ to get a nice howto smile

sudo apt-get install -y driftnet dsnif aircrack airsnort kismet

# CD and audio

sudo apt-get install -y workman workbone aumix cdtool eject setcd indent

# crypto support

sudo apt-get install -y openssl ca-certificates

# Smartcard support

sudo apt-get install -y libccid pcscd libopensc-openssl opensc mozilla-opensc libpam-opensc libopensc1-dev pcsc-tools


Configuring sound and video

Viewing Real Video 4.0 movies

TMPDIR=/tmp/realplayer
mkdir -p $TMPDIR
cd $TMPDIR
wget http://homes.esat.kuleuven.be/~decockd/repository/rp8_linux20_libc6_i386_cs2_rpm
wget http://homes.esat.kuleuven.be/~decockd/repository/rv9_libc6_i386_cs2.tgz
sudo cp rp8_*rpm /root
sudo apt-get install xine-ui libxine1 libxine-dev realplayer
tar xfz rv9_libc6_i386_cs2.tgz
cd $TMPDIR/rv9/codecs
sudo cp rv40.so.6.0 drv4.so.6.0 /usr/lib/RealPlayer8/Codecs/

# You can now enjoy your movie:

xine video.ram


Using Ubuntu and debian in general

Package management (dpkg, apt, dselect, synaptic,...)

How can I use a cd with a debian package repository?

# You should register that cd with apt:
sudo apt-cdrom add
sudo apt-get update

Network configuration

What if your wireless access point is not detected by default?

  1. Make sure that you activated the wireless interface. Most laptops have a button to switch the wireless interface on/off. You can observe whether your wireless card actually receives something with kwifimanager:
    sudo apt-get install -y kwifimanager
    kwifimanager &
    
    

    Once you started kwifimanager, you can click File -> Connection Statistics to look at the noise/signal level history. If your wireless interface has not been activated, you will see a flat line. If the line is not flat, it has been switched on smile

  2. Once you are sure the wireless interface has been activated, you can restart the network interfaces:
    sudo /etc/init.d/networking restart
    
    

  3. If the wireless network is still not actif, you can shoot your troubles with the network-admin system tool:
    sudo network-admin &
    
    

    This tool should tell you "wireless connectionm, the interface XXXn is active" is active, and that your default gateway points to that device.

  4. If the network-admin tool tells you that "the interface XXXn is not configured", or that "the interface XXXn is not active", you can proceed as follows:
    1. left-click the wireless connection of your choice
    2. click the properties button
    3. tick the box next to "This device is configured" if it has not yet been ticked
    4. enter the essid of your network
    5. enter the wep key if appropriate
    6. enter the ip address settings (dhcp is usually ok)
    7. accept your settings clicking the OK button
  5. If the network-admin tool tells you that "the interface XXXn is not active", and you are sure its properties are correct, then you can:
    • click the Activate button
  6. If it still does not work, I would suggest to check with http://www.google.com smile


Instructions under construction...

Enabling Suspend to Ram

sudo su -
echo apm >> /etc/modules
awk '/# kopt/ { $0 = $0" apm=on" } {print}' /boot/grub/menu.lst > /boot/grub/menu.lst.tmp
mv /boot/grub/menu.lst.tmp /boot/grub/menu.lst
echo shpchp >> /etc/hotplug/blacklist
echo pciehp >> /etc/hotplug/blacklist
exit

  • You can now reboot your machine
  • Once your machine comes up, you can close the laptop lid, or press the suspend button to make your machine sleep smile

Enabling Hibernation -- Suspend to Disk

sudo perl -pi -e 's/#ACPI_SLEEP/ACPI_SLEEP/' /etc/default/acpi-support


Mounting your ntfs partitions read/write

  1. # Download and install the appropriate packages:
    mkdir /tmp/captive-ntfs
    cd /tmp/captive-ntfs
    wget http://www.jankratochvil.net/project/captive/dist/captive-static-1.1.5-0.i386.rpm
    sudo apt-get install -y linux-headers-`uname -r` alien
    
    

  2. # Derive a debian package from the rpm:
    sudo alien captive-static-1.1.5-0.i386.rpm
    
    

  3. # Install the new debian package:
    sudo dpkg -i captive-static_1.1.5-1_i386.deb
    
    

  4. # Execute the following command to discover where Microsoft stores the ntfs.sys and related files... Be patient... This process is very time and memory consuming...
    sudo nice captive-install-acquire
    
    

  5. # Add the ntfs partitions to your /etc/fstab:
    sudo captive-install-fstab -v --add
    
    

  6. # You can now mount your ntfs partition in read/write with:
    sudo mount /mnt/captive-noname
    
    

  7. # Remember to copy to/from your ntfs partition using super-user rights:
    sudo cp -a /home/$USER/whatever /mnt/captive-noname/whatever.coming.from.unix
    
    

  8. # You can unmount your ntfs partition with:
    sudo umount /mnt/captive-noname
    
    


Configuring your machine as a print server

  • Install the cups print server packages:
sudo apt-get install -y cupsys gnome-cups-manager

  • Start the gnome-cups-manager:
gnome-cups-manager &


 

Welcome at Godot.Be

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Godot's Twiki? Send feedback