Setting up Ubuntu

Customizing the launcher

Removing icons

The Lanucher is the vertical stack of application icons at the left end of the window. Clicking on an icon starts the corresponding application. To remove unnecessary applications from the Lanucher, right-click on the icons and choose Unlock from Launcher. Unix users normally start their application from a terminal window, so you probably want to have few icons in the Launcher.

Adding a terminal application

You will need a terminal window to issue Unix commands. A recommended terminal applications is gnome-terminal. Click on the uppermost icon in the Launcher, called Dash Home. Install the Gnome terminal application by writing its name in the Application text field. Then right-clicking on the corresponding new icon in the Launcher and choose Lock to Launcher. Now you have an icon from the Gnome terminal.

You can create tabs in the Gone terminal by clicking on that window and type Ctrl-shift-t for each tab you want.

Customizing the keyboard

Programmers frequently need curly braces and brackets. An American/English keyboard has these key in convenient places to the right on the keyboard. If your keyboard is not American/English, you can easily add a vritual American/English keybord. Click on the System Settings icon in the Lanucher, then Keyboard Layout, then Options..., then Key(s) to change layout, choose Right Ctrl + Right Shift. In the Keyboard Layout window, click on English (US) keyboard, then on the + button, find an the keyboard that corresponds to your physical keyboard (e.g., Norwegian (Macintosh, eliminate dead keys). Thereafter, you can switch between an English/American keyboard and the physical keyboard using Ctrl (on the left) and the right shift key. The keyboard in action can be viewed to the right in the panel at the top of the Ubuntu window.

The Control key is heavily used in Unix systems, and many prefer to have the Control key on the Caps Lock key. You can do this in the host system. Alternatively, you can set this in Ubuntu: click on the System Settings icon in the Launcher, click Keyboard Layout, then Options..., click Ctrl key position, click Caps Lock as Ctrl.

Convenient shortcuts

Installing packages

Text editor

Install an excellent text editor, either emacs or vim (gedit comes with standard Ubuntu):

Terminal> apt-get install emacs
Terminal> apt-get install vim

Web browser

Ubuntu comes with the Firefox web browser, but occasionally it does not launch correctly. An alternative is Gnome's Epiphany browser:

Terminal> apt-get install epiphany-browser

If you prefer the Chrome browser, launch firefox or epiphany-browser, download Chrome as a .deb file (downloaded files go by default to the Downloads directory). Then run

Terminal> cd Downloads
Terminal> sudo apt-get install libgconf2-4 libnss3-1d
Terminal> sudo dpkg -i google-chrome-stable_current_amd64.deb

Useful software

Some installation scripts (actually used to build Vagrant virtual machines) can be used to conveniently install basic packages for a scientific computing environment in a Linux machine:

For example,

Terminal> bash

Here is a brief explanation of some of the most important packages in a Linux installation.

command description
mercurial version control system
git version control system
subversion version control system
bzr version control system
imagemagick collection of tools for image files
konsole alternative to gnome-terminal
g++ GNU C++ compiler
gfortran GNU Fortran compiler
auto* tools for installing software
wdiff useful diff program for plain text
kdiff3 diff program for plain text
meld diff program for plain text
latexdiff diff program for latex files
diffpdf diff program for PDF files
antiword fast conversion of MS Word files to plain text
vlc audio and video player
mencoder tool for making movie files
texlive-* tools for TeX and LaTeX
latex-* tools for LaTeX
libreoffice OpenOffice tools
a2ps convert plain text to PostScript for printing
pandoc convert between many file formats
gv Ghostview PDF and PostScript viewer
pdftk tools for manipulating PDF files
pdfjam tools for manipulating PDF files
gconf-editor configure settings for Gnome applications
ispell spell checker

Ultra-quick intro to Unix (sufficient for programming)

command description
mkdir make directory (folder)
cd change directory (folder)
emacs start an editor for writing programs
ls list files (in the current folder)
ls -l list files with size, date and owner info
rm remove file
rm -r remove folder
mv move (rename) file or folder
cp copy file
cp -r copy folder
ls > res store output of a program (here ls) in a file (here res)
less res look quickly at a file (here res), press q to quit
ssh -X name@machine log in on another "machine" as "name"

Unix commands are written in a terminal window, also called console window, xterm, rxvt, konsole, or shell.

Below is a sample session illustrating all the commands above. We

  1. create a new folder named mydir
  2. move to the new folder
  3. start the emacs editor and write a program file
  4. copy to
  5. rename to
  6. list the files in the current folder
  7. delete
  8. list the files in the current folder
  9. move back to the parent folder
  10. rename the mydir folder to the new name trash
  11. list files in this folder and redirect output of ls to a file
  12. look at the file with less
  13. delete the trash folder
  14. log on to another machine,, under the name smartie
Here are the 14 commands, written in a terminal window:

Unix> mkdir mydir
Unix> cd mydir
Unix> emacs &
Unix> cp
Unix> mv
Unix> ls
Unix> rm
Unix> ls
Unix> cd ..   # .. is the quick name of the parent folder
Unix> mv mydir trash
Unix> ls > out
Unix> less out   # press q to quit less
4 -rw-r--r-- 1 hpl hpl 6 2008-08-21 07:33 trash
out (END)
Unix> rm -r trash    # need the -r to remove a folder
Unix> ssh -X

Everything after # is a comment in Unix. Note that cd .. is a quick way of moving one folder up in the folder hierarchy.

Here are some more Unix goodies:

Unix> tar cvzf myprograms.tar.gz *.py   # pack
Unix> tar xvzf myprograms.tar.gz        # unpack