Ubuntu:Oneiric for printing

From

Jump to: navigation, search




Ubuntu 11.10 (Oneiric Ocelot)

Introduction

  • On October 14, 2011, Ubuntu 11.10 was released.
  • It is codenamed Oneiric Ocelot and is the successor to Natty Narwhal 11.04 (Natty+1).
  • Oneiric Ocelot is not an LTS (Long Term Support) release and is no longer supported with security updates (as of April 2013). It is recommended to upgrade to the current version of Ubuntu.


Contents


General Notes

General Notes

  • This is the original Ubuntuguide. You are free to copy this guide but not to sell it or any derivative of it. Copyright of the names Ubuntuguide and Ubuntu Guide reside solely with this site. This Ubuntu help guide is neither sold nor distributed in any other medium. Beware of copies that are for sale or are similarly named; they are neither endorsed nor sanctioned by this guide. Ubuntuguide is not associated with Canonical Ltd nor with any commercial enterprise.
  • Ubuntu allows a user to accomplish tasks from either a menu-driven Graphical User Interface (GUI) or from a text-based command-line interface (CLI). In Ubuntu, the command-line-interface terminal is called Terminal, which is started:
Menu -> File -> Open Terminal
Text inside the grey dotted box like this should be put into the command-line Terminal.
  • Many changes to the operating system can only be done by a User with Administrative privileges. 'sudo' elevates a User's privileges to the Administrator level temporarily (i.e. when installing programs or making changes to the system). Example:
sudo bash
  • 'gksudo' can be used instead of 'sudo' when opening a Graphical Application through the "Run Command" dialog box or as a menu item. Example:
gksudo gedit /etc/apt/sources.list
  • Many file management tasks can be accomplished with root Administrative privileges by starting the Nautilus file manager in a similar fashion. (Use 'gksudo' if starting Nautilus from a menu item.)
gksudo nautilus
or
sudo nautilus
  • "man" command can be used to find help manual for a command. For example, "man sudo" will display the manual page for the "sudo" command:
man sudo
  • While "apt-get" and "aptitude" are fast ways of installing programs/packages, you can also use the Synaptic Package Manager, a GUI method for installing programs/packages. Most (but not all) programs/packages available with apt-get install will also be available from the Synaptic Package Manager. In this guide, when you see
sudo apt-get install package

you can search for package in Synaptic and install it that way.

  • Many instructions use the text editor "nano" (which is universally available in Linux). However, it is often easier to use the text editor "gedit" in Ubuntu instead.
  • "Menu" refers to the menu bar at the top (or bottom) of the desktop, akin to the Start menu in Microsoft Windows or the Menu bar of the Apple Macintosh.
  • If you are using the 64-bit version, replace any "i386" with "amd64"

Other versions

How to find out which version of Ubuntu you're using

Open the command terminal and type:

lsb_release -a

How to find out which kernel you are using

uname -a

Newer Versions of Ubuntu

  • Ubuntu has a six month release cycle, with releases in April and October.
  • Precise Pangolin (12.04 LTS) will be released in April 2012 and will be a Long Term Support version

Older Versions of Ubuntu

Other Resources

  • Ubuntu Forums has a large community for online solutions and specific help.

Ubuntu Resources

Unity Desktop

Unity is the default desktop environment used in Ubuntu. It is compatible with the GTK platform used by Gnome. It was designed to be used for netbooks, but is developed by Canonical to be useful on all types of devices.

Gnome Project

Gnome3 is an alternative desktop available for Ubuntu, and a list of Gnome projects is available.

sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install gnome-shell
sudo add-apt-repository ppa:ubuntugnometeam/gnome3
sudo add-apt-repository ppa:ubuntugnometeam/ppa-gen
sudo apt-get update
sudo apt-get install ugr-desktop-g3
sudo apt-get dist-upgrade

Ubuntu Screenshots and Screencasts

New Applications Resources

Other *buntu guides and help manuals

  • Kubuntuguide -- Kubuntu uses the popular KDE desktop environment
  • Lubuntu -- Lubuntu can run with as little as 256 MB RAM. It is better for older machines with limited resources.
  • Edubuntu -- Edubuntu is a collection of software bundles optimized for use in educational environments. LTSP (thin client terminal server support) and many networking tools are bundled. A version for use with KDE (Kubuntu) is available.
  • SkoleLinux / DebianEdu -- a collection of (open-source) educational tools for Debian/Ubuntu Linux
  • Ubuntu Doctors Guild -- a collection of tips for using (K)Ubuntu Linux in health care environments
  • official Ubuntu Server Guide -- a good starting reference for server packages

Installing Ubuntu

Warning: During installation, there is an advanced option (Ready to install -> Advanced) to install the GRUB2 bootloader into the same partition into which the (K)Ubuntu OS is installed but not to change the MBR (Master Boot Record). Pay careful attention during this step if your system uses a boot partition, uses multiple OS (more than 2), or chainloads bootloaders. For systems with such a boot partition, it is best not to overwrite the MBR.

Hardware requirements

Ubuntu Oneiric Ocelot runs well with as little as 384 Mb RAM. (The GUI installer requires a minimum of 256 Mb RAM, while the alternative text-based installer can run using only 192 Mb RAM.) Netbooks can run Ubuntu Oneiric Ocelot, which has been optimised for that platform.

The installation takes between 3-4 Gb hard drive space, and 8 - 10 Gb will be needed to run comfortably. (However, at least 25-30 Gb will likely be needed for routine usage.)

If you have an older computer with less memory than this, consider Lubuntu (if 160 Mb RAM or greater), PuppyLinux (if 256 Mb or greater), or DSL (if minimal RAM, limited hard drive space, running from a USBdrive, or running from within another OS).

Fresh Installation

See this guide for burning the ISO image to a CD ("LiveCD").
Use the LiveCD for installation.
  • The Alternate CD version also allows the use of the same fast text-based installer used in the Server version (requiring less RAM), and there are more installation options than on the Desktop CD ("Regular Download").

Install a classic Gnome-appearing User Interface

  • A Gnome 3 interface gnome-shell can be installed, and a choice (from the Login Manager) of running in Unity or Gnome 3 will then be available:
sudo apt-get install gnome-shell
  • A user interface resembling the classic Gnome 2 interface (used in Ubuntu Lucid Lynx and earlier versions) can be installed. (This installs the gnome-shell modules as well.) A choice of running Unity or Gnome as the desktop environment will then be available from the Login Manager.
sudo apt-get install gnome-session-fallback
  • A complete Ubuntu Gnome Shell Remix OS (an unofficial Ubuntu derivative) is also available from which the Unity desktop environment has been removed entirely, and is more similar to a Debian distribution with a Gnome desktop.
  • Of course, if you would like to use Ubuntu with the popular and powerful KDE desktop, use Kubuntu.

Dual-Booting Windows and Ubuntu

A user may experience problems dual-booting Ubuntu and Windows. In general, a Windows OS should be installed first, because its bootloader is very particular. A default Windows installation usually occupies the entire hard drive, so the main Windows partition needs to be shrunk, creating free space for the Ubuntu partitions. (You should clean up unnecessary files and defragment the drive before resizing.) See changing the Windows partition size.

After shrinking a Windows partition, you should reboot once into Windows prior to installing Ubuntu or further manipulating the partitions. This allows the Windows system to automatically rescan the newly-resized partition (using chkdsk in XP or other utilities in more recent versions of Windows) and write changes to its own bootup files. (If you forget to do this, you may later have to repair the Windows partition bootup files manually using the Windows Recovery Console.)

Newer installations of Windows use two primary partitions (a small Windows boot partition and a large Windows OS partition). An Ubuntu Linux installation also requires two partitions -- a linux-swap partition and the OS partition. The Linux partitions can either be two primary partitions or can be two logical partitions within an extended partition. Some computer retailers use all four partitions on a hard drive. Unless there are two free partitions available (either primary or logical) in which to install Ubuntu, however, it will appear as if there is no available free space. If only one partition on a hard drive can be made available, it must be used as an extended partition (in which multiple logical partitions can then be created). Partition management can be done using the GParted utility.

If there are only two existing primary partitions on a hard drive (and plenty of free space on it) then there will be no problem installing Ubuntu as the second operating system and it is done automatically from the Ubuntu LiveCD. Allow the Ubuntu LiveCD to install to "largest available free space." Alternatively, if there is an extended partition with plenty of free space within it, the Ubuntu LiveCD will install to this "largest available free space" as well.

The main Windows partition should be at least 20 Gb (recommended 30 Gb for Vista/Windows 7), and a Ubuntu partition at least 10 Gb (recommended 20 Gb). Obviously, if you have plenty of disk space, make the partition for whichever will be your favoured operating system larger. For a recommended partitioning scheme, see this section.

Conversely you can install a retail version of Windows (but not an OEM or recovery version) after Ubuntu by creating a primary NTFS partition using GParted. (You may have to use GPparted from a Live CD/USB). Once the primary NTFS partition is created you can boot your Windows CD/DVD and choose to install Windows to that NTFS partition. When installation is complete, reboot to insure Windows boots properly. Once that is ascertained, use the Ubuntu Live CD/USB to install GRUB back to the MBR. (This is necessary because Windows overwrites the MBR and designates its own bootloader as the master bootloader.) Once GRUB is installed you will be able to boot either OS.

Alternatives include:

  • Wubi (Windows-based Ubuntu Installer), an officially supported dual-boot installer that allows Ubuntu to be run mounted in a virtual-disk within the Windows environment (which can cause a slight degradation in performance). Because the installation requires an intact functioning Windows system, it is recommended to install Ubuntu in this manner for short-term evaluation purposes only. A permanent Ubuntu installation should be installed in its own partition, with its own filesystem, and should not rely on Windows.
  • EasyBCD, a free Windows-based program that allows you to dual-boot Windows 7/Vista and Ubuntu (as well as other operating systems) by configuring the Windows 7/Vista bootloader.

Installing multiple OS on a single computer

Warning: During installation, there is an advanced option (Ready to install -> Advanced) to install the GRUB2 bootloader into the same partition into which the (K)Ubuntu OS is installed but not to change the MBR (Master Boot Record). Pay careful attention during this step if your system uses a boot partition, uses multiple OS (more than 2), or chainloads bootloaders. For systems with such a boot partition, it is best not to overwrite the MBR.

  • Example, from the Desktop version GUI installer, a point in the installation will be reached:
Summary -> Advanced -> Device for boot loader installation: /dev/sda6

In this example, this setting will cause the GRUB2 bootloader to be installed into /dev/sda6 only (the partition into which the new (K)Ubuntu OS is being installed). The MBR (Master Boot Record) will not be changed. However, if the default setting of /dev/sda is allowed, then GRUB2 will not only be installed into partition dev/sda6 (into which the (K)Ubuntu OS is installed) but also the MBR (MasterBootRecord) will be changed so that the copy of GRUB2 stored there will be designated as the master bootloader for all Operating Systems on the entire computer. This may be undesirable if you wish to use bootloaders other than GRUB2.

If you want to install more than 2 operating systems on a single computer, check out these tips. Also see these tips regarding manipulating partitions.

Use Startup Manager to change Grub settings

Grub is a bootup utility that controls which OS to load by default and other bootup settings. You can change Grub settings from Startup Manager, a GUI that is able to manage settings for Grub (Grub Legacy), Grub 2, Usplash, and Splashy. Also see the Ubuntu Community help page for Startup Manager usage instructions. Install:

sudo apt-get install startupmanager menu

Run:

Menu -> System -> Administration -> Startup Manager

Note: You can also edit the Grub settings manually from the command-line interface.

Dual-Booting Mac OS X and Ubuntu

Mac OS X has a similar structure to Linux (it is BSD Unix based). Dual-booting Mac OS X and Ubuntu detailed instructions can be found here.

Installing Mac OS X after Ubuntu

  • If you decide to dual boot with OS X, choose ext2 as your partition type during the Ubuntu installation. (For this the Super Grub Disk CD is a useful utility. You can download the Super Grub .iso image file at forjamari.linex.org and burn the image to a CD-ROM.)
  • Once you have installed Ubuntu, edit the Grub start-up list:
sudo nano /boot/grub/menu.lst
and add the following lines:
title Mac OS X
root (hd0,0)
makeactive
chainloader +1

Reboot your Mac and go to the terminal in Max OS X (if you have any issues booting, boot from your Mac OS X DVD). Press F8 and enter -s. Enter:

fdisk -e /dev/rdisk0
flag 2 <--note that flag 2 is my Mac partition number two
quit
y
reboot
  • If are still unsure whether it is working correctly, use the Super Grub Disk CD and make grub active.

Installing Ubuntu after Mac OS X

  • If you get an error message during boot such as HFS+error in the bootloader, you can also use the Super Grub Disk for recovering Linux GRUB and the Windows MBR (Master Boot Record).
  • Once you have installed Ubuntu, edit the Grub start-up list:
sudo nano /boot/grub/menu.lst
and add the following lines:
title Mac OS X
root (hd0,0)
makeactive
chainloader +1
If you have issues with Mac OSX or Windows in GRUB, try changing the Mac OS X Grub entry
change root (hd0,0) to root (hd0,1)

This means you will boot into partition number 1. You can try any partition number until you get it right.

Upgrading from older versions

There are several methods for upgrades from the command-line interface (Konsole) (which can be used for both the desktop and server editions of Kubuntu/Ubuntu).

  • This is the preferred method:
sudo apt-get install update-manager-core
sudo do-release-upgrade
  • You can also use the update-manager (all editions):
sudo apt-get install update-manager
sudo update-manager -d
  • You can also use:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
(Note: the first two lines simply make sure your current distribution is current before upgrading the entire distribution, and are optional.

Always backup your system. Upgrades do not generally work for me, because I often make customizations to my older installations (to make my hardware work with them) but these customizations are often not required in the newest version. When the system then attempts to migrate my customizations (during an attempted upgrade), it often crashes my new system. (Fortunately, I always back up my important files, and reinstalling them on a fresh OS installation is therefore usually accomplished relatively quickly.) Here are some of the steps I have sometimes needed to take when performing upgrades.

  • In general, upgrades must be done serially from one version to the next in order.

Reinstalling applications after a fresh installation

If you upgrade your Ubuntu system with a fresh installation, it is possible to mark the packages and services installed on your old system (prior to the upgrade) and save the settings ("markings") into a file. Then install the new version of Ubuntu and allow the system to reinstall packages and services using the settings saved in the "markings" file. For instructions, see this Ubuntu forum thread. In brief:

  • On the old system:
Synaptic Package Manager -> File -> Save Markings
  • Save the markings file to an external medium, such as a USB drive.
  • Complete the backup of your system's other important files (e.g. the /home directory) before the installation of the new system.
  • In the freshly-installed new system:
Synaptic Package Manager -> File -> Read markings and load the file on your USB drive (or other external storage) previously saved.

Note: Many packages, dependencies, and compatibilities change between version of Ubuntu, so this method does not always work. Automated updates remains the recommended method.

  • Alternatively you can use this command-line method.
  • Prior to the clean installation. run:
dpkg --get-selections > ~/my-packages 
This creates a my-packages file in the ~ (home) directory which will contain a list of the packages installed on the old system. Copy this file to a safe place (as you will need it after the new installation).
  • Proceed with the clean installation. Enable the same repositories that were enabled in the old system.
  • Now copy the my-packages file to the ~ (/home) folder. Run:
sudo dpkg --set-selections < my-packages && sudo apt-get dselect-upgrade
Any packages that you had installed (that are in the new repositories) will now be installed. Excluded will be any manually-installed packages (that are not in the new repositories) and any packages that were compiled from source.
  • Here are some of the steps I have sometimes needed to take when performing upgrades.

Add Extra Repositories

Software packages and programs are freely available for download at multiple online sites with standardized structures, called repositories. There are repositories officially sanctioned and monitored by the Kubuntu/Ubuntu developer community, while other repositories are independently provided, without official sanction or supervision (and should be used with caution). Additional information is available from the Ubuntu Repository Guide.

Types of Repositories

  • There are four major package repository types in Ubuntu:
  • main - Supported by Canonical. This is the major part of the distribution.
  • restricted - Software not licensed under the GPL (or similar software license), but supported by Canonical.
  • universe - Software licensed under the GPL (or similar license) and supported by users.
  • multiverse - Software not licensed under the GPL (or similar license), but supported by users.
  • There are also these additional types of repositories:
  • oneiric-updates - Updates to official packages.
  • oneiric-backports - Current version software from Precise Pangolin (Oneiric+1) that have been backported to Oneiric Ocelot.
  • oneiric-proposed - Proposed updates & changes (bleeding edge stuff).

Third party repositories

Software developers often maintain their own repositories, from which software packages can be downloaded and installed directly to your computer (if you add the repository to your list). Many of these third party repositories and software packages have never been reviewed by the (K)Ubuntu/Debian community and can present a security risk to your computer. Trojans, backdoors, and other malicious software can be present at any unregulated repository. When using repositories not endorsed by the (K)ubuntu/Debian community, make sure you have utter confidence in that site before enabling the repository and installing a software package from it.

PPA repositories

A Personal Package Archive (PPA) is a special software repository used for experimental source packages still under development. Such software has not been approved by the Debian or Ubuntu developers (but may eventually become an accepted package). Use this software at your own risk just like any other third party repository software.

Documentation about how to install software from this type of repository can be found at the PPA Installing Software Guide.

In brief, to add a repository:

sudo add-apt-repository ppa:user/ppa-name

Note: If add-apt-repository is not available on your system, then install it with the package:

sudo apt-get install python-software-properties

Add Repositories using Synaptic Package Manager

This is the preferred method.

  • Menu -> System -> Administration -> Synaptic Package Manager -> Settings -> Repositories.
  • Here you can enable the repositories for Ubuntu Software and Third Party Software.
  • For Third Party Software select Add -> enter the repository's address. It will have a format similar to:
deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://archive.ubuntu.com/ubuntu/ oneiric main restricted
  • Example: To add the Medibuntu repository, Add:
deb http://packages.medibuntu.org/ oneiric free non-free
  • Download the repository key to a folder.
  • Example: The Medibuntu key can be downloaded from
http://packages.medibuntu.org/medibuntu-key.gpg
  • Then add the key from:
Menu -> System -> Administration -> Synaptic Manager -> Settings -> Repositories -> Authentication -> Import Key File...
  • (Alternatively, you can manually add the key from the command line Terminal. See Add Repository keys.)
  • Refresh the package list from the new repository:
Synaptic -> Reload

Manually add repositories

  • Adding a repository (such as a Launchpad ppa repository) can be accomplished from the command-line interface:
sudo apt-add-repository ppa:user/repository

where ppa:user/repository is an example of the repository you wish to add.

  • To remove a repository:
sudo apt-add-repository -r ppa:user/repository
  • Refresh the packages list from the new repositories:
sudo apt-get update

Edit the repository sources list

  • This is an optional, labor intensive method. Do this at your own risk. Modify the default Ubuntu sources.list only if you understand what you're doing. Mixing repositories can break your system. For more information see the Ubuntu Command-line Repository guide.
  • Create a backup of your current list of sources.
sudo cp -i /etc/apt/sources.list /etc/apt/sources.list_backup

Note: sudo - runs the command with root privileges. cp = copy. -i = prompt to overwrite if a file already exists.

  • Edit the list of sources:
sudo nano /etc/apt/sources.list
or using a graphical editor:
gksudo gedit /etc/apt/sources.list
  • Note: To use your local mirror you can add "xx." before archive.ubuntu.com, where xx = your country code.
Example: deb http://gb.archive.ubuntu.com/ubuntu licid main restricted universe multiverse indicates a repository for Great Britain (gb).
  • Here is a sample sources.list. At the end have been added repositories for Medibuntu and Google:
#deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386]/ oneiric main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://gb.archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric universe
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
deb http://archive.canonical.com/ubuntu oneiric partner
deb-src http://archive.canonical.com/ubuntu oneiric partner

deb http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb http://security.ubuntu.com/ubuntu oneiric-security universe
deb-src http://security.ubuntu.com/ubuntu oneiric-security universe
deb http://security.ubuntu.com/ubuntu oneiric-security multiverse
deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse

## Medibuntu - Ubuntu 11.10 "Oneiric Ocelot"
## Please report any bug on https://bugs.launchpad.net/medibuntu/
deb http://packages.medibuntu.org/ oneiric free non-free
deb-src http://packages.medibuntu.org/ oneiric free non-free

# Google software repository
deb http://dl.google.com/linux/deb/ stable non-free

  • Refresh the packages list from the new repositories:
sudo apt-get update

Add repository keys

  • Download the gpg keys for the repositories and automatically add them to your repository keyring:
  • Example: To obtain and add the Medibuntu repository key:
wget --quiet http://packages.medibuntu.org/medibuntu-key.gpg -O - | sudo apt-key add -
  • Example: To obtain and add the Google repository key:
wget --quiet http://dl.google.com/linux/linux_signing_key.pub -O - | sudo apt-key add -

Note: wget - retrieves a file from a network location. --quiet = no output. -O = Output downloaded item to terminal. The | (pipe symbol) is used to capture the output from the previous command (in our case the screen) and use it as an input for the piped command (i.e. apt-key, which adds it to the keyring).

  • Alternatively (and perhaps more easily), you can use apt-key directly:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY
where KEY is the missing key code printed in apt-get output, e.g. EF4186FE247510BE.
Note: Key servers often use port 11371. Make sure your firewall allows port 11371 to be open.

Package Installation and Updates

Apt and Package Basics

Most new users will use the Synaptic Package Manager to install packages. These instructions are for installing packages from the command-line Terminal. Terminal can be started:

Menu -> Applications -> Accessories -> Terminal
  • Install packages:
sudo apt-get install packagename
  • Example:
sudo apt-get install mpd sbackup
  • Remove packages:
sudo apt-get remove packagename
  • To remove all dependencies:
sudo apt-get autoremove
  • Example:
sudo apt-get remove mpd sbackup
  • Search for packages:
apt-cache search <keywords>
  • Examples:
apt-cache search Music MP3
apt-cache search "Text Editor"
sudo apt-get update
  • Upgrade packages:
sudo apt-get upgrade
  • Upgrade the entire distribution (e.g. from Maverick to Natty):
sudo apt-get dist-upgrade

Installing .deb packages

Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them, since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal).

  • Install a downloaded Debian (Ubuntu) package (.deb):
sudo dpkg -i packagename.deb
  • Remove a Debian (Ubuntu) package (.deb):
sudo dpkg -r packagename
  • Reconfigure/Repair an installed Debian (Ubuntu) package (.deb):
sudo dpkg-reconfigure packagename
*Example:
sudo dpkg-reconfigure mpd

Handling (Tar/GZip) and (Tar/Bzip2) archives

(Tar/GZip) archives end in ".tar.gz" and (Tar/Bzip2) archives end in ".tar.bz2". Bzip2 is the newer, more efficient compression method. These files can generally be automatically extracted by merely clicking on them from your file manager (Nautilus), since file associations with the appropriate archival utilities are set by default in Ubuntu. These instructions are for those who wish to use the command line Terminal.

  • To extract:
tar xvf packagename.tar.gz

Note: tar is an application which can extract files from an archive, decompressing if necessary.

-x means extract.
-v means verbose (list what it is extracting).
-f specifies the file to use.
  • Decompressing ".gz" files
gunzip file.gz
  • Decompressing ".bz2" files
bunzip2 file.bz2
Note: You can also decompress a package first by using the command gunzip (for .gz) or bunzip2 (for .bz2), leaving the .tar file. You would then use tar to extract it.
  • To create a .gz archive:
tar cvfz packagename.tar.gz folder
  • To create a .bz2 archive:
tar cvfj packagename.tar.bz2 folder

Installing a package from source

  • Make sure you have all the necessary development tools (i.e. libraries, compilers, headers):
sudo apt-get install build-essential linux-headers-$(uname -r)
Note: "uname -r" lists the current kernel you are using
  • Extract the archive that contains the source files:
tar xvf sourcefilesarchive.tar.gz
  • Build the package using the package's script (in this case the configure script), compile the package (make), and install the compiled package into your system (make install):
cd /path/to/extracted/sourcefiles
./configure
sudo make
sudo make install
Note: typing ./ before a filename in the current folder allows the Linux shell to try and execute the file as an application even if it is not in the path (the set of folders which it searches when you type a command name). If you get a "permission denied" error, the file is not marked as being executable. To fix this:
sudo chmod +x filename
Example: In the above instructions, configure is the shell script to build the package from source. To be sure the configure script is executable:
sudo chmod +x configure
Create a .deb package from source files

If your build from source is successful, you can make a Debian (Ubuntu) package (.deb) for future use:

  • Install package tools:
sudo apt-get install checkinstall
  • Rebuild package using "checkinstall":
cd /path/to/extracted/package
./configure
sudo make
sudo checkinstall
  • Keep the resulting ".deb" file for future use. It can later be installed using:
sudo dpkg -i packagename.deb

Note: These are basic instructions that may not always work. Some packages require additional dependencies and optional parameters to be specified in order to build them successfully. Also see these Ubuntu wiki instructions. More info about .deb package structure can be found here.

Aptitude

Aptitude is a terminal-based package manager that can be used instead of apt-get. Aptitude marks packages that are automatically installed and removes them when no packages depend on them. This makes it easy to remove applications completely. To use Aptitude, replace apt-get with aptitude in the command line. Example:

sudo aptitude install packagename
sudo aptitude remove packagename
sudo aptitude update
sudo aptitude upgrade

For an ncurses-based graphical user interface, type

sudo aptitude

For more information, see the aptitude documentation.

Synaptic Package Manager

While "apt-get" and "aptitude" are fast ways of installing programs/packages, you can also use the Synaptic Package Manager (Menu -> System -> Administration -> Synaptic Manager), a GUI method for installing programs/packages. Most (but not all) programs/packages available with apt-get install will also be available from the Synaptic Package Manager. This is the preferred method for most desktop users. In this guide, when you see

sudo apt-get install package

you can simply search for package in Synaptic and install it that way.

Menu -> System -> Administration -> Synaptic Package Manager
  • Search for the name of the program/package. You can also search for a word in its description.

-> Mark for Installation -> Apply

  • The selected program(s) will be automatically installed, along with its dependencies.

Ubuntu Software Center (Add/Remove Programs)

Not all packages available from apt-get, aptitude, and Synaptic Package Manager are available in the Ubuntu Software Center. However, it is the easiest interface for new users of Ubuntu and directs them to preferred packages.

Menu -> Applications -> Ubuntu Software Center
  • Search for the sort of program you want to add. Example: type MP3 to see a list of mp3 software.

-> Mark for Installation -> Apply

  • The selected program(s) will be automatically installed.

Manual Updates

  • Manually, from Terminal (command line interface):
sudo apt-get update
sudo apt-get upgrade
or
  • Use Synaptic Package Manager:
Menu -> System -> Administration -> Synaptic Package Manager -> "Reload" then "Mark all upgrades"
If there are packages available for updating, you will be prompted whether to install them.

Automated Updates

  • Use Synaptic Package Manager:
Menu -> System -> Administration -> Synaptic Manager -> Settings -> Preferences -> General -> Reloading Outdated Package Information -> Automatic

Repair broken packages

If a package installation fails (which can cause a Package Manager to freeze or become locked), or if a package has unsatisfied dependencies causing a similar condition, then run one (or both) of the following commands from the command-line terminal:

sudo apt-get install -f
sudo dpkg --configure -a

Desktop Add-ons

There are many add-on icons, themes, wallpapers, 3-D effects, and other customizations available for the GNOME desktop.

Gnome Eye-Candy Resources

  • Gnome Look has wallpapers, splash screens, icons, and themes for windows managers (including Metacity and Compiz) and other applications.

Ubuntu Wallpaper

Change Plymouth Splash Screen

This is the initial splash screen you see at bootup. Different Plymouth themes can be found by searching for plymouth-theme in a Package Manager. Install a new one and then:

sudo update-alternatives --config default.plymouth
sudo update-initramfs -u
and manually select the theme you wish to use.

Plymouth does not reliably work with nVidia drivers and during bootup a blank screen may result for several seconds.

Metacity

Metacity is the default desktop compositing manager in Gnome. It is lightweight, streamlined and does not have many configurable options, but has multiple themes available at Gnome Look.

Compiz Fusion

Compiz Fusion is available as a separate Windows Manager, to allow advanced desktop effects such as the rotating cube desktop. Many Ubuntu users choose to run Compiz, which is quite fast in Ubuntu. Install:

sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-main compiz-fusion-plugins-extra emerald librsvg2-common

To change to Compiz as the Window Manager:

  • Select Compiz Configuration:
Menu -> System -> Preferences -> CompizConfig Settings Manager
Note: You must logout and log back in for the change to take effect.

Fusion Icon

Fusion Icon is a tray icon that allows you to easily switch between window managers, window decorators, and gives you quick access to the Compiz Settings Manager. This allows quick toggling of 3-D desktop effects (that may not be compatible with some applications).

sudo apt-get install fusion-icon
Menu -> Applications -> System Tools -> Compiz Fusion Icon

You can then easily access CompizConfig Settings Manager from the icon.

Rotate the Compiz Cube

Set the CompizConfig Settings Manager to enable the "Desktop Cube" and "Rotate Cube" and "Viewport Switcher" options. Click on the icon for each to customize settings. For example, to change the appearance of the cube, click on the Desktop Cube icon to access its settings. You can set the hotkey buttons for rotating the cube in the "Viewport Switcher" settings. Otherwise, hold down the Ctrl+Alt+Left mouse button and drag the mouse (or touchpad) the direction you want to rotate the cube.

Remember, the cube rotates between desktops. It's not a cube unless you have at least 4 desktops running. You will not get a cube if you are only using 2 desktops (you will get a "plate"). You can still rotate the sides of the plate, of course, but it will not be a cube. (Recent users from the Windows OS may have no experience with the concept of simultaneous desktops, but they are nice once you learn how to use them).

When running Compiz fusion as the Windows Manager, you must change the default number of desktops from within CompizConfig Settings Manger. To enable 4 desktops:

CompizConfig Settings Manager -> General -> General Options -> Desktop Size -> Horizontal Virtual Size -> 4

When you start an application, you can assign it to any one of the 4 desktops by right-clicking the upper left corner of the application window and choosing the "To Desktop..." option. Rotating the cube shows the different desktops. You can also go to a desktop using the taskbar icon which shows the 4 desktops.

Emerald

Emerald is the theme engine for Compiz Fusion. Multiple themes are available. (These themes originated from the Beryl project before it merged with Compiz to form Compiz Fusion.) The Emerald Theme Manager for Compiz Fusion can be installed:

sudo apt-get install emerald

Google Desktop

Google Desktop for Linux was a proprietary suite of Google widgets and applications. It was discontinued in September 2011.

gDesklets

gDesklets are similar to Windows widgets and Google gadgets and provide information such as weather, system resources, and news primarily for the Gnome desktop (i.e. Ubuntu Maverick and older). Install:

sudo apt-get install gdesklets

Dock applications

Avant Window Manager, Cairo Dock, gnome-do and Wbar are dock-like applications for Ubuntu Linux. A dock represents running programs as icons at the bottom of the screen (as is done on the Mac OS X desktop), instead of by toolbar panel segments (as is done in Windows and other Linux window managers). See this brief comparison of dock applications.

Avant Window Navigator

  • Avant Window Navigator requires that a desktop composition manager (such as Metacity, Compiz, Xcompmgr, KDE4 (Kubuntu), or xfwm4 (Xubuntu)) be installed and running.
  • Install and upgrade proprietary nVidia or ATI graphics drivers so that the compositing manager functions properly.
  • Install AWN:
sudo apt-get install avant-window-navigator awn-manager
(Note: If you are using Gnome (Ubuntu) and do not already have a compositing manager installed (such as Compiz), Metacity will be installed as part of the installation.)
  • Enable automatic startup of AWN at bootup:
  • Menu -> System -> Preferences -> Startup Applications -> Add...
avant-window-navigator
  • Select which applets should run from the dock menu by default:
  • Menu -> Applications -> Accessories -> Avant Window Navigator Manager
You can drag application icons onto the list, then activate or deactivate the applets from the list.

Cairo Dock

Cairo Dock can be used either with a desktop compositing manager (such as Metacity for Gnome, Compiz, or the KDE4 Window Manager) or without one. See the Ubuntu installation instructions for details. It is available from the repositories:

sudo apt-get install cairo-dock cairo-dock-plug-ins

Gnome Do

Gnome Do is a docking utility for Gnome. Install:

sudo apt-get install gnome-do
  • From the preferences pane of gnome-do select the Docky look and feel to get the dock (rather than the default Quicksilver-like) look and feel.

wbar

wbar is a quick-launch bar (not a dock) that has an appearance similar to Avant Window Manager and Cairo Dock. It is GTK (Gnome) based but can work in all desktop environments. It does not require a compositing manager to be installed and is therefore quicker and more suitable for low-end hardware systems. It is the default in the Google gOS desktop and is available as a .deb package from Google. Download and install (from the command-line Terminal):

wget http://wbar.googlecode.com/files/wbar_1.3.3_i386.deb 
sudo dpkg -i wbar_1.3.3_i386.deb
  • Start wbar with custom start options (e.g. by pressing alt+F2). Here is an example:
wbar -isize 48 -j 1 -p bottom -balfa 40 -bpress -nanim 3 -z 2.5 -above-desk
Here is another example:
wbar -above-desk -pos bottom -isize 60 -nanim 1 -bpress -jumpf 0.0 -zoomf 1.5

For a full list of command-line startup options, see:

wbar --help

Tip: If you want the "wave" effect just increase the -nanim value. I like the icons to just pop up so I don't use it, but with 9 icons 5 there is a nice "wave" effect.

Obviously, you could create a menu item with the command line options (similar to the examples above), or a batch file that can be automatically started at system startup (as a cron event or startup session).

You can also change wbar startup options by editing the configuration file:

sudo gedit /usr/share/wbar/dot.wbar

See this example configuration file. However, not all options are able to be set from the configuration file and must be run from the command line. For more info see this wbar guide.

wbarconf

A simple wbar configuration utility can be downloaded as a .deb package and installed:

wget http://koti.kapsi.fi/~ighea/wbarconf/wbarconf_0.7.2-1_i386.deb
sudo dpkg -i wbarconf_0.7.2-1_i386.deb

Virtualization

Virtualization allows a second operating system (OS), such as Windows or OS X, to be run from within (K)Ubuntu. This requires extra RAM (because both (K)Ubuntu and the virtualized second OS require separate amounts of RAM) and a license for the second OS. If you wish to run a virtualized instance of Windows XP, for instance, you must have a license for Windows XP.

VirtualBox

VirtualBox is a fast and complete virtualization solution owned and maintained by Sun Microsystems. There is a free and fully open-source edition available under the GNU GPL license.

  • Install the open-source edition:
sudo apt-get install virtualbox-ose virtualbox-ose-source virtualbox-guest-additions
  • You can also add the QT-version (if using KDE/Kubuntu, for example):
 sudo apt-get install virtualbox-ose-qt
  • Start VirtualBox:
Menu -> VirtualBox OSE PC virtualization solution

For usage instructions, see the End-user documentation. For information on installing Virtualbox in Windows so that Ubuntu can then be installed within in a virtual machine running in Windows, see this page.

Proprietary versions of VirtualBox

A few additional features that are not yet in the OSE version, such as a USB device interface, are available in the proprietary version of VirtualBox. To install a proprietary edition of VirtualBox:

  • Add the security key:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
echo "deb http://download.virtualbox.org/virtualbox/debian maverick non-free" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update 
  • Install:
sudo apt-get install virtualbox

VMWare

VMWare is a commercial virtualization platform that currently offers two free products: VMWare Player and VMWare Server (the latter with a free renewable yearly license). VMWare Player can play virtual appliances that have already been created, whereas VMWare Server (which has a broader range of features) allows the creation of virtual machines. In general, VMWare Server is recommended unless you only need to play an appliance. (Appliances will also run in VMWare Server). Users that wish to run servers (or processes) that need to be available to a network from within the virtual machine should use VMServer. If you wish to install a new OS within a virtual machine (other than in an appliance), you will need VMWare Server.

VMWare Player

Installation instructions are on the website, or at the Ubuntu community wiki. In brief, to install the free VMWare Player:

  • Install pre-requisites:
sudo apt-get install build-essential linux-headers-$(uname -r)
  • Get the binary package/installation script, give it executable privileges, then run the installation script:
wget http://download3.vmware.com/software/vmplayer/VMware-Player-2.5.3-185404.i386.bundle
chmod +x VMware-Player-2.5.3-185404.i386.bundle
sudo ./VMware-Player-2.5.3-185404.i386.bundle
  • Run:
Menu -> Applications -> System Tools -> VMWare Player

Create an Ubuntu Appliance

While any edition of Ubuntu can be installed in a virtual machine, the minimal installation option (F4) of the Ubuntu Server creates a highly-efficient edition (previously known as JeOS) optimised for use within a virtual appliance (which can then be played using VMWare Player or other virtual machine client). See this walkthrough.

A virtual appliance for VMWare Player (using this JeOS minimal server) can also be built using vmbuilder.

VMWare Server

  • Install pre-requisites:
sudo apt-get install build-essential linux-headers-$(uname -r)
  • Download the server source files for your architecture (32-bit or 64-bit) from the VMWare Server website and retrieve your license key by email.
  • Extract the files, give execution privileges to the install script, and run the install script:
tar xvf VMware-server-2.0.1-156745.i386.tar.gz
cd vmware-server-distrib
chmod +x vmware-install.pl
sudo ./vmware-install.pl
VMWare Package

VMWare Appliances (that include an Ubuntu/Debian OS) can be created using VMWare Server and the VMWare Package utility. These appliances can then be deployed to users who can play them using VMWare Player. Install:

sudo apt-get install vmware-package

Keyboard errors in VMware guest

After installing VMWare 6.5, and installing a guest OS, the Function, arrow and Del/End/etc keys do not function. This is a bug with VMWare´s code. Add this line to ~/.vmware/config (create file if necessary) to fix this issue:

xkeymap.nokeycodeMap = true

KVM

KVM is the free open source virtualization solution implemented as a Linux kernel module (in the recent kernels) for computers whose processors contain virtualization extensions (Intel VT or AMD-V). See the Ubuntu installation instructions. Install:

sudo apt-get install kvm

Qemu (without KVM)

If your computer does not have the virtualization extensions, you can still run the QEMU virtualization platform. See this Ubuntu community documentation. It can be installed from source code.

Xen

Xen is an efficient open-source virtualization ("hypervisor") platform (which includes a merge with QEMU). It is the basis for the Amazon EC2 Cloud and is generally intended for use on a server (or on "baremetal" systems, i.e. no OS yet installed). It is free open source under a GPL license. The latest desktop (and installation instructions) is available from the website. (A commercial version is also offered by Citrix.) Implementation in Ubuntu requires some modification, currently. For more info, see the Ubuntu community documentation. Install:

sudo apt-get install xen-hypervisor xen-docs convirt

A Xen virtual machine host can also be installed automatically with certain 64-bit CPUs, using the 64-bit Ubuntu Server LiveCD. (A (K)Ubuntu desktop can then later be added -- see Ubuntu server).

Virtual Machine Manager

Virtual Machine Manager is an application to allow viewing of all instances of virtual machines on your system. It includes a secure implementation of VNC. This and other virtual management tools are available as an integrated package in (K)Ubuntu. Install:

sudo apt-get install ubuntu-virt-mgmt

Crossover for Linux

Codeweavers' Crossover Office for Linux is a subscription-based commercial package that allows many Windows programs to be run on Ubuntu without the need for a Microsoft OS license or a complete virtualization system. See the website for more info. Codeweavers releases older versions of this product into the free package Wine.

Wine

Wine is a free open-source package that is similar to (and implements many elements of) CrossOver for Linux. Like CrossOver for Linux, no Microsoft license or virtualization platform is required to run Windows programs. See these instructions for installing the latest version of Wine.

sudo apt-get install wine

Also consider installing Microsoft's TrueType fonts:

sudo apt-get install msttcorefonts

PlayOnLinux

PlayOnLinux is a Wine frontend which simplifies the installation and launch of many Windows programs, particularly games. Install:

sudo apt-get install playonlinux
Internet Explorer 7

Internet Explorer 7 can be installed with PlayOnLinux. Select "Internet Explorer 7" from the "Internet" section of PlayonLinux.

Internet Explorer 6 & 7

Internet Explorer 6 & 7 can function under Wine, albeit imperfectly. For most purposes, Firefox can be used (with the User Agent Switcher plugin) to mimic Internet Explorer.

  • Make sure you have Wine and cabextract packages:
sudo apt-get install wine cabextract
wget http://winetricks.org/winetricks
sudo chmod +x winetricks
  • Install with winetricks:
sh winetricks ie6
sh winetricks ie7

Note: Winetricks is automatically installed with the current version of Wine.

Transgaming Cedega

Cedega is a commercial application (similar to CrossOver Office and Wine), for installing and running some Windows applications, specifically games, without the need for virtualization or a Microsoft license. It provides 3D support, software acceleration support, and a high level of DirectX support. Installation instructions are found on the website.

Mono

Mono is a free open source project sponsored by Novell to allow .NET programs to function in Linux ((K)Ubuntu) and Mac OS X. . Several GNOME applications (like Tomboy, F-Spot, and Banshee) require mono to be installed, so mono may already be installed by default on your system. The most recent version is available here.

sudo apt-get install mono-2.0-devel

Moonlight

Java

  • Install Java:
sudo apt-get install default-jre

DosBox

DOSBox is a DOS-emulator that emulates CPU:286/386 realmode/protected mode, Directory FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, and a SoundBlaster/Gravis Ultra Sound card (for sound compatibility with older games). You can "re-live" classic games that otherwise won't run on newer computers.

sudo apt-get install dosbox

ScummVM

ScummVM allows certain classic graphical point-and-click adventure games to run (provided you already have their data files). ScummVM replaces the executables shipped with the games, allowing play on Linux operating systems (for which they were not originally designed).

sudo apt-get install scummvm

Edutainment Applications

There are many superb applications that can be installed with a single click.

Menu -> Applications -> Ubuntu Software Center-> Education

Below are a few examples that can be installed from this menu:

  • Celestia -- a free planetarium and space simulator for the desktop

Stellarium -- an astounding planetarium for the desktop

  • K3DSurf -- a program for modeling 3,4,5, and 6 dimensional models.
  • Bibletime-- a Bible study tool using the QT platform
  • Zekr -- an Islamic Quran study tool (available in Utilities)
  • Oregano -- a program for electrical engineering schematics
  • RlPlot -- a high quality graph generator
  • Mnemosyne -- a flash-card tool
  • Gramps -- map your family-tree and co-operate with genealogy projects

Games

There are some phenomenal games for (K)Ubuntu Linux.

There are hundreds of free, open-source games available in (K)Ubuntu. Most (including the KDE Games collection and the Gnome Games collection) can be accessed through the Games section of your Package Manager.

Examples are:

  • PouetChess -- an excellent 3-D chess game (sudo apt-get install pouetchess)
  • PokerTH -- a very nice Texas Hold 'Em Poker (install using PPA repository)
  • Kajongg -- a real MahJongg game, for humans and/or robots (sudo apt-get install kajongg)
  • Planet Penguin Racer -- Penguin slides down a 3-D luge run, catching fish. (Extreme Tux Racer is a newer version, but works in 32-bit only.)
  • KsirK -- play Risk against the computer or in a multiplayer environment (sudo apt-get install kdegames)
  • Racer -- the 3-D "real deal" Car Racing game (install binary found here). Also with extra tracks and add-ons.
  • TORCS -- the 3-D Car Racing game (sudo apt-get install torcs)
  • Supertuxkart -- the go-kart racing game (sudo apt-get install supertuxkart)
  • Pingus -- a Lemmings clone (similar to Super Mario Bros.) that uses penguins instead of lemmings (sudo apt-get install pingus)
  • Frozen Bubble -- the bubble-popping game (sudo apt-get install frozen-bubble)
  • Frets on Fire -- similar to Guitar Hero. You can import songs from Guitar Hero and from community sites (sudo apt-get install fretsonfire)
  • Scorched3d -- turn-based artillery game in a 3D rendered landscape (sudo apt-get install scorched3d)
  • Pyscrabble (and pyscrabble-server) -- online Scrabble game and server (sudo apt-get install pyscrabble pyscrabble-server) (Also see Lexulous and the Internet Scrabble Club for browser-based online games similar to Scrabble. Internet Scrabble Club requires Java: sudo apt-get install default-jre . It also requires firewall port 1325 to be open inbound/outbound.)

Wing Commander Privateer

The Linux version of this free version of Wing Commander can be downloaded as a binary here.

Vdrift

Vdrift is a free open source 3-D racing game, similar to Need for Speed, with realistic physics, multiple drift tracks, and multiplayer games. Support for joysticks, mice and keyboard is included. A binary package for Linux is available from the website.

Action

Incredible action games (including those from the Top 25) are available in Ubuntu. Many can be installed using:

Menu -> Applications -> Ubuntu Software Center -> Games

Examples are:

  • Alien Arena -- a multi-player first person shooter action game with free servers. (Package: alien-arena) (Server: alien-arena-server)
  • OpenArena -- an open-source multi-player first person shooter action game, with free servers. (Package: openarena) (Server: openarena-server)
  • Tremulous -- a Halo-like multiplayer first person shooter action game. The repositories have the current version. (Package: tremulous) (Server: tremulous-server)
  • Sauerbraten - a multiplayer graphics-rich first person shooter game evolved from Cube. (Package: sauerbraten) (Server: sauerbraten-server)
  • Nexuiz -- an open-source multi-player first person shooter game with free servers and tournaments. (Package: nexuiz) (Server: nexuiz-server) A 35 map add-on community pack is also available here. To install it, extract the map pack to /home/username/.nexuiz/data (or ~/.nexuiz/data ).

Note: Many of these games require advanced graphics. Make sure you have the necessary hardware drivers activated.

UrbanTerror

UrbanTerror is a multiplayer first person shooter action game (with an integrated server). It uses the open-source quake 3 engine and features many real weapons and free-to-use servers for multi-player functionality. "Not recommended for adolescents in Germany." Download and install the binary using these instructions.

Doom

Skulltag, ZDoom, and PrBoom (Freedoom) are versions of Doom2. For Doom3, see Doom3 on Ubuntu.

Skulltag

Skulltag is an updated version of ZDoom that includes network play. See the website for simple (K)Ubuntu installation instructions. (You can use the Freedoom Iwad (see below) if you don't have an original Doom2.wad.) Note: Most of the modules require dependencies from the Universe repositories. Make sure you have the Universe repositories enabled (Synaptic Package Manager -> Settings -> Repositories -> Edit Software Sources -> Community-maintained Open Source software (universe) -> (ticked)).

  • Install prerequisites:
sudo apt-get install timidity timidity-interfaces-extra
  • Then add the skulltag repositories, update, and install Skulltag and DoomSeeker (the Skulltag online server utility):
echo "deb http://skulltag.net/download/files/release/deb/ jaunty multiverse" | sudo tee /etc/apt/sources.list.d/skulltag.list
sudo apt-get update
sudo apt-get install skulltag doomseeker-skulltag
  • If you don't have a doom2.wad, tnt.wad, or plutonia.wad already, you can copy the freedoom.wad to your ~/.skulltag folder:
cd ~/.skulltag
wget http://mirror.cinquix.com/pub/savannah/freedoom/freedoom-iwad/freedoom-iwad-0.6.4.zip
unzip freedoom-iwad-0.6.4.zip
cp freedoom*/doom2.wad .
rm freedoom-iwad-0.6.4.zip
  • If you need more help (regarding the Skulltag-server, firewalls, and port forwarding with Skulltag, for example), see these additional tips.
  • Skulltag runs on any platform, with any graphics, and on almost any computer. There are thousands of add-ons, maps, and gameplay modes, giving a nearly endless variety of gameplay. The interface makes obtaining and playing the modifications very easy. This is my favorite game of all time (and I have been playing it for years).

PrBoom

PrBoom is a free open source port of the original first person shooter action game, Doom2. It does not have the advanced options of ZDoom. Freedoom is a free Iwad (set of maps) to replace the original Doom2.wad.

sudo apt-get install prboom freedoom timidity timidity-interfaces-extra

There are thousands of extra maps (Wads) available for this game. It is easiest to keep a directory for your wads in your home directory:

mkdir /home/user/wads
or alternatively, use the /usr/share/games/doom folder, giving universal privileges to the folder:
chmod -R 777 /usr/share/games/doom

Place your doom2.wad, tnt.wad, or plutonia.wad (from your original game) into this folder. If you don't have one, you can copy the Freedom version of doom2.wad from /usr/share/games/freedoom into this folder. Place any new .wad's you have downloaded from the Internet into this folder as well. Then run the game using both the original iwad map as well as your new .wad map (you will only see the new map).

prboom -iwad /home/user/wads/doom2.wad -file /home/user/wads/new_wad.wad

Note: Only doom2.wad, tnt.wad, or plutonia.wad can be used as an iwad. You must have one of these in addition to any new wad you wish to use. When in doubt, use doom2.wad.

Note: this game can also be installed using Menu -> Applications -> Ubuntu Software Center -> Games as Freedoom, but you must also install timidity and timidity-interfaces-extra.

MMORPG

Spring

The Spring Project is a scripting engine platform to develop and play free multiplayer games such as Star Wars Imperial Winter and Complete Annihilation. Install:

sudo apt-get install spring

Regnum Online

Regnum Online MMPORG -- see basic installation instructions and the help forum as needed.

PlaneShift

PlaneShift is a free full-immersion online fantasy game (MMPORG). Client downloads and patches are available here.

  • Make the downloaded binary installation file executable:
cd /directory_where_downloaded
chmod +x PlaneShift-v0.5.4-x64.bin
  • Run the executable binary as root (this must be done from the command line Terminal):
sudo ./PlaneShift-v0.5.4-x64.bin
  • Follow the instructions for installation. When prompted whether to manually set permissions, answer "no."
  • During installation, most users have recommended installing this game to your /home directory as a single user installation, instead of to /opt for all users. This avoids permissions problems. I was able to install to /opt, but it takes some effort.
  • Make sure your user belongs to the games group:
Menu -> System -> Administration -> Users and Groups -> user -> Manage Groups -> games -> Properties -> Group Members -> user (ticked) -> OK
Menu -> Applications -> Lost & Found -> Client and Setup

To run it from the menu, I had to edit the menu entries by checking the box: "Run in terminal." Alternatively, run it from the command-line Terminal:

sudo /opt/PlaneShift/pssetup
sudo /opt/PlaneShift/psclient

Notes: This game ran very slowly for me on a 32-bit installation with a DSL connection and I gave up. The 64-bit installation worked better.

Dolphin (Wii emulator)

The Dolphin emulator is an open-source cross-platform Wii emulator that allows many Wii game disks to be run on many operating systems. (Whether the Wii Netflix disk will run under the Dolphin emulator has not yet been established.) (The Dolphin-emulator has no relationship to the KDE Dolphin file manager). Installation instructions are here.

Internet Applications

Internet applications enable you to make full use of your Internet connection. Web browsers, Email clients, Instant Messengers, and more are included in this category.

Web Browsers

Mozilla Firefox

Mozilla Firefox is the ubiquitous web browser. Based on open source components, it is trademarked and cannot be altered or re-distributed with any change that involves the name or trademarks. Install the current version:

sudo apt-get install firefox

Firefox Plug-ins

Adblock Plus plug-in (block ads in a web page)

Adblock Plus blocks ads that appear in web pages. It is an important tool to limit tracking and undesirable website elements, as well. You can subscribe to a free filter service, and can add to the block list individual ads and website elements with a single click.

sudo apt-get install xul-ext-adblock-plus
  • You can also add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> AdBlock Plus. (This method will also ensure that automatic updates are installed by Firefox.)
  • Recent versions of Adblock Plus allow the display of a large number of "partner" ads unless you disable this undesirable behavior:
Firefox -> Tools -> Add-ons -> Adblock Plus -> Preferences -> Filter preferences... -> Allow some non-intrusive advertising (unticked)

Because Adblock Plus appears to now be creating holes in its own blocking service, it is probably worthwhile to stop automatic updates and only update Adblock Plus selectively (in case the developers in the future decide to create even more holes in the plug-in's blocking capability without the corresponding option to disable the behavior).

NoScript plug-in (controls scripts)

The NoScript plugin is considered one of the most important security measures for browsing the Internet. Most viruses and trojans gain access to computers from the Internet through scripts. This plugin allows you to choose which scripts to allow and blocks the rest.

  • Add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> NoScript. (This method will also ensure that automatic updates are installed by Firefox.)
  • NoScript has a long of websites on its "whitelist." It is important to review this list and remove the websites for which you don't wish to automatically allow scripts (I remove them all).
Firefox -> Tools -> Add-ons -> NoScript -> Preferences -> Whitelist
  • A large number of websites use multiple locations/URLs to assemble their webpage content, a process which is blocked by NoScript's ABE (Application Boundaries Enforcer) function. I have found it necessary to disable ABE in order for most of my websites to function correctly.
Firefox -> Tools -> Add-ons -> NoScript -> Preferences -> Advanced -> ABE -> Enable ABE (unticked)
  • Many websites now use aggressive pop-ups to place advertising in front of the actrual content. While NoScript can block these ads, there will be a "placeholder" still blocking the content unless you turn off the placeholders:
Firefox -> Tools -> Add-ons -> NoScript -> Preferences -> Embeddings -> Show placeholder icon (unticked)
  • Most websites use scripting extensively these days, so that you may need to "Allow" a website in NoScript. To block the individual undesirable elements of the website, use AdBlock Plus.
Bookmark Favicon Changer plug-in

In the newest versions of Firefox, there are some bugs regarding the Favicons (the small icons that appear in the address bar) and the Bookmark icons. This plug-in will restore the icons that get erased (leaving a blank dotted box) or allow you to choose your own Favicons / Bookmark icons.

  • Add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> Bookmark Favicon. (This method will also ensure that automatic updates are installed by Firefox.)
RefreshBlocker plug-in (prevents redirects)

RefreshBlocker allows the user to decide which websites (and pages) will be allowed to redirect (based on META tags within the webpage). Although Firefox (as of version 3.5) blocks all directs by default, the behavior is not customizable; it is therefore preferable to turn off the Firefox redirect control and use RefreshBlocker instead.

  • Add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> RefreshBlocker. (This method will also ensure that automatic updates are installed by Firefox.)
  • Turn off the Firefox automatic redirect blocker:
Firefox -> Enter about:config in the browser location bar -> right-click on "accessibility:blockautorefresh" -> Toggle to change the value from true to false
Video DownloadHelper plug-in for Firefox

The Video DownloadHelper plugin allows the download of videos (including Flash videos) from sites like YouTube.

  • You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> Video DownloadHelper. (This method will also ensure that automatic updates are installed by Firefox.)
User Agent Switcher plug-in for Firefox

Now that Firefox is the world's leading web browser, this plug-in should no longer be necessary. Still, there still exist a few old web apps that will only run on IE (and for them this plug-in may be useful). The User Agent Switcher plugin allows a browser to masquerade as another browser, allowing (most of the time) browser-specific content to be displayed.

  • You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> User Agent Switcher. (This method will also ensure that automatic updates are installed by Firefox.)
Unplug Download Management

The UnPlug add-on lets you save video and audio which is embedded on a webpage.

  • You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Browse All Add-ons. (This method will also ensure that automatic updates are installed by Firefox.)
Lucifox (eBook reader extension)

Lucifox (Lucidor for Firefox) enables e-books to be read and e-book catalogs to be browsed in a Firefox window.

  • To install, go to the website and click "Download Now."
Java Runtime Environment (JRE) for Firefox plug-in

This package also installs the Java Runtime Environment. (JRE is also installed when OpenOffice or ubuntu-restricted-extras is installed.)

sudo apt-get install sun-java6-jre sun-java6-plugin

Note: You must accept the license to use this product.

Adobe Acrobat Reader for Firefox Plug-in

This plugin is allows you to view Adobe Acrobat (PDF) files within the Firefox browser.

deb http://archive.canonical.com/ubuntu Oneiric partner
then install Adobe Reader:
sudo apt-get install acroread
  • Alternatively, this plugin is also available from the Medibuntu repository. Add the Medibuntu repository to your repository list:
deb http://packages.medibuntu.org/ Oneiric free non-free
then install:
sudo apt-get install acroread mozilla-acroread acroread-plugins acroread-fonts
Adobe Flash Player for Firefox Plug-in

To install the official Adobe Flash plugin (Flash 10) for Firefox:

sudo apt-get install adobe-flashplugin
Gnash Plug-in (Open source Flash Player replacement)

Gnash is available in a 64-bit version as well as a 32-bit version. It is the open source replacement for Adobe Flashplayer.

sudo apt-get install gnash

After installing, change your web browser's Preferences -> Applications so that SWF and SPL files use Gnash.

VLC plug-in for Firefox

This package allows the popular VLC player to play media within the Firefox browser.

sudo apt-get install mozilla-plugin-vlc
Gecko MediaPlayer Plug-in for Firefox

Gecko MediaPlayer is a browser plugin for all Gecko-based browsers (Firefox, SeaMonkey, IceApe, Opera) that allows Mplayer to play multimedia within the browser. Install:

sudo apt-get install gecko-mediaplayer

An alternative is to use the mplayer plugin for Firefox. Install:

 sudo apt-get install mozilla-mplayer
Kaffeine Plug-in for Firefox

This package allows the Kaffeine media player (often used in KDE-based desktops) to play multimedia within the Firefox browser.

sudo apt-get install kaffeine-mozilla
Helix player plug-in for Firefox

This package installs the Helix player (the open source player that plays Real Player content in Linux) as well as the plugin that plays RealMedia within the Firefox browser.

sudo apt-get install mozilla-helix-player
Moonlight plugin for Firefox

Moonlight is part of the Novell Mono project that is an open source implementation of Silverlight (the Microsoft multimedia presentation platform). It is based on FFMpeg. It is made to work best with the Firefox 3 web browser, as a plugin (but also works with other mozilla browsers). Version 2.3 is available as a plugin for mozilla-based browsers:

sudo apt-get install moonlight-plugin-mozilla
The stable version 2.4 is available here. The Moonlight 3.99 plugin (compatible with most Silverlight 3/4 content) is here.
  • Netflix under Moonlight
Netflix streaming requires both the capabilities of Silverlight 2.0 and Digital Rights Management modules. Although the current version of Moonlight 2.0 will run most Silverlight content (including Netflix content), Netflix has not yet released Digital Rights Management modules for Linux. Please contact Netflix directly for further information or sign a petition.
  • An HTML5 Netflix plugin (currently being developed by Google for the Chrome browser) may soon be available. Another alternative is the Netflix Android app which can be used in a virtual Android environment.
FireFTP for Firefox

FireFTP is a Firefox extension for FTP transfers.

Firefox Widgets

Turn off browser bar drop-down list in Firefox

This is the most frequently asked problem regarding Firefox. To turn off the location browser bar drop-down list (and therefore not show your browsing history):

Firefox -> about:config (in the location browser bar) -> browser.urlbar.maxRichResults -> right-click -> Modify -> set value to 0

Turn off SSL certificate name in address bar

In newer versions of firefox, the validity of the SSL certificate associated with a website is displayed as a color-coded background to the Favicon (the small icon displayed in the address bar). However, Firefox currently also displays the name of the site issuing the SSL certificate, which can be annoying, since for most sites this is a duplicate of the domain name (which then gets displayed twice in the address bar). To turn off this behavior:

Firefox -> about:config (in the location browser bar) -> browser.identity.ssl_domain_display -> right-click -> Modify -> set value to 0

View Firefox cache

In a new window/tab, enter about:cache in the Firefox address bar. You can view and save individual elements (from all open windows/tabs) in the cache from there.

IceCat

IceCat is Firefox distributed without the Mozilla trademark restrictions. It is endorsed by the Debian project (on which Ubuntu is based). It is formerly known as IceWeasel and is also known as IceApe Browser. Install the current version:

sudo apt-get install iceape-browser

SeaMonkey

SeaMonkey is an open-source integrated internet application suite (including web browser, IM (IRC) client, Email client, RSS/News reader, and web development tools). It is based on the same components as the Mozilla products and shares the trademark and branding restrictions. There are many plugins, similar to those for Thunderbird and Firefox. Install:

sudo apt-get install seamonkey

IceApe

IceApe is an open-source integrated internet application suite (including web browser, IM (IRC) client, Email client, RSS/News reader, and web development tools). It is based on the same components as the Mozilla product SeaMonkey, but has no restrictive trademark licensing, and is endorsed by the Debian project (on which Ubuntu is based). Install the current version:

sudo apt-get install iceape

Opera

Opera is a proprietary browser and internet suite (currently free on PCs) also used in some mobile devices and gaming consoles. It includes email, an address book, IRC chat, integrated BitTorrent, and webfeeds. A limited number of plugins are also available. Download from the website and follow the instructions or install from the Opera repository:

echo "deb http://deb.opera.com/opera/ stable non-free" | sudo tee /etc/apt/sources.list.d/opera.list
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo apt-get install opera

Chromium

Chromium is the open-source browser on which the Google Chrome browser is based. Install:

sudo apt-get install chromium-browser
  • Start Chromium:
Menu -> Applications -> Internet -> Chromium Web Browser

Google Chrome

Google Chrome is Google's web browser. Based on the Chromium browser, Google adds the Google name and logo, an auto-updater system called GoogleUpdate, RLZ, and other Google add-ons. Download and install it here.

Download Managers

MultiGet

MultiGet is a GTK-based free-standing download manager utility.

sudo apt-get install multiget

Usenet Clients

Pan

Pan is a Gnome-based Usenet reader and nzb binary downloader. Install:

sudo apt-get install pan

Kwooty

Kwooty is a Usenet reader and nzb binary downloader for KDE4. Installation instructions from source or PPA repositories are at the website.

Email Clients

Evolution

Evolution is the default Gnome-based email client in Ubuntu. If not installed:

sudo apt-get install evolution

Evolution and PGP

Email messages can be encrypted in PGP and sent by email using Evolution. See this tutorial for an example how to configure it.

Thunderbird

Mozilla Thunderbird is a licensed and trademarked free open-source email client that is compatible with Firefox. Install:

sudo apt-get install thunderbird

Lightning calendar extension

Lightning is the calendar extension for Thunderbird (with functionality similar to the stand-alone application Sunbird). It is currently available in a 32-bit version only. (If using a 64-bit OS, install the Sunbird calendar client instead.) Install by clicking on the Linux download at the website.

Enigmail

Enigmail is an add-on to Thunderbird that allows you to easily encrypt your email using OpenPGP, which is included in the kernel by default. It also allows you to create and manage the encryption keys. Go the website and click "Download Now". (64-bit versions are found here.) Install:

Thunderbird -> Tools -> Add-ons -> Install -> select downloaded file

or

sudo apt-get install enigmail
  • Also see these tips for instructions on setting up e-mail with PGP encryption.

New Mail Icon for Thunderbird

"New Mail Icon" is an experimental tray add-on which notifes you of new mail. Download from the website. Install:

Thunderbird -> Tools -> Add-ons -> Install -> select downloaded file

KMail

KMail (Kontact Mail) is the default email client included with Kontact in KDE (Kubuntu). Kontact includes email, an address book, a calendar, reminders, pop-up notes, a link to the Akregator News/RSS reader, time-tracking, and more. Install:

sudo apt-get install kontact

Newsreaders

Akregator

Akregator is the default news/RSS reader included with Kubuntu (KDE). Usage instructions are found in the Handbook. Install:

sudo apt-get install akregator

RSSOwl

RSSOwl is a Java-based RSS | RDF | Atom Newsfeed Reader.

Install java and in order to use the internal browser, install the packages xulrunner and firefox:

sudo apt-get install sun-java6-jre firefox xulrunner

Change to your "opt" directory:

cd /opt

Download the zip-archive into your opt directory:

sudo wget http://downloads.sourceforge.net/rssowl/rssowl-2.0.6.linux.zip

Extract the archive and remove the extracted file:

sudo unzip ./rssowl-2.0.6.linux.zip && sudo rm ./rssowl-2.0.6.linux.zip

Make a startscript:

sudo gedit /usr/bin/runRSSOwl.sh

add the following lines to your startscript file /usr/bin/runRSSOwl.sh and save it afterwards.

    #!/bin/bash
    cd /opt/rssowl
    ./RSSOwl

Make the startscript executable:

sudo chmod u+x /usr/bin/runRSSOwl.sh

To start RSSOwl:

runRSSOwl.sh

Instant Messengers

Empathy

Empathy is an open source IM application. It is the default in the Ubuntu (Gnome) desktop. You can access multiple services with it. If not already installed, you can install it:

sudo apt-get install empathy

Pidgin

Pidgin is an open source IM application. It is the previous default in the Ubuntu (Gnome) desktop. You can access multiple services with it.

sudo apt-get install pidgin

Kopete

Kopete is the default Instant Messenger application for Kubuntu. You can access multiple services with it. Install:

sudo apt-get install kopete

Kopete Styles

Additional styles for Kopete are available from KDE-look. Install from:

Kopete -> Settings -> Configure -> Chat Window -> Style -> Get New...

GoogleTalk on Kopete

Kopete can be configured to work with GoogleTalk Instant Messaging (but not VOIP) using the Jabber protocol. See these GoogleTalk instructions.

Konversation (IRC client)

Konversation is the default Kubuntu Internet Relay Chat (IRC) client. It functions similar to the venerable mIRC. "A little less action and a little more Konversation." -- Elvis. Install:

sudo apt-get install konversation

aMSN

aMSN is an MSN Messenger utility that functions like the original client. It is alternative to Pidgin for MSN users. Install it:

sudo apt-get install amsn

To enable Drag-and-Drop capabilities to aMSN for easy file transfer see Ubuntu Geek.

Emesene

Emesene is an MSN messenger client that uses a simplified interface similar to the original client. It is alternative to Pidgin for MSN users. Install it:

sudo apt-get install emesene

FTP Clients

You might wish to use a dedicated FTP client instead of the one in your browser. Also see these FTP tips.

Filezilla

Filezilla is the ubiquitous free open-source FTP client and server for all platforms.

sudo apt-get install filezilla

Filesharing / P2P

Do not share copyrighted material or content that is otherwise illegal to share.

Transmission (BitTorrent Client)

Transmission is the GTK-based default BitTorrent client in Ubuntu (Gnome).

sudo apt-get install transmission

KTorrent

KTorrent is the default BitTorrent client in Kubuntu. See these additional tips. Install:

sudo apt-get install ktorrent

Be sure to have your firewall ports open (by default 6881 and 4444).

Azureus

Azureus is a Java-based BitTorrent client.

sudo apt-get install azureus

QTorrent

QTorrent is a PyQT-based BitTorrent Client that is supposed to be very fast.

QTorrent

Apollon (P2P Filesharing)

Apollon is an older BitTorrent client oriented towards KDE. It uses plugins for compatibility with multiple networks.

sudo apt-get install apollon gift

MLDonkey (P2P eMule/eDonkey2000)

MLDonkey is a P2P file sharing program (and network) that is able to use different network protocols. To install the MLDonkey core server, follow these instructions.

MLDonkey GUI frontends

  • Install the Gnome GUI frontend for MLDonkey:
sudo apt-get install mldonkey-gui
sudo apt-get install kmldonkey

Opentracker (Torrent tracker)

Opentracker is the most widely used torrent tracker software. It can be used within a private organisation or as a public service to track freely-available torrents. Download (through CVS) and installation instructions are at the website.

Videoconferencing and VOIP

Videoconferencing and voice over Internet (VOIP) applications are merging into integrated applications. Most of these applications now allow placing calls to non-Internet based telephones for a small fee.

Ekiga

Formerly known as Gnomemeeting, Ekiga is a SIP compliant fully functional open source integrated VOIP and videoconferencing program.

sudo apt-get install ekiga

Skype

Skype is a proprietary integrated VOIP and video conferencing program similar to Ekiga. Also see instructions on how to record Skype conversations.

  • Install pre-requisites:
sudo apt-get install libqt4-dbus libqt4-network libqt4-xml
  • To get the most recent version, download and install the 32-bit version:
wget -O skype-ubuntu-current_i386.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-32
sudo dpkg -i skype-ubuntu-current_i386.deb
sudo rm skype-ubuntu-current_i386.deb
  • In the past. some users have noted that they cannot get their microphone inputs to work with any version later than 2.1.0.47. They installed:
wget -O skype-ubuntu-current_i386.deb http://download.skype.com/linux/skype-debian_2.1.0.47-1_i386.deb
sudo dpkg -i skype-ubuntu-current_i386.deb
sudo rm skype-ubuntu-current_i386.deb
or
wget -O skype-ubuntu-current_amd64.deb http://download.skype.com/linux/skype-ubuntu-intrepid_2.1.0.47-1_amd64.deb
sudo dpkg -i skype-ubuntu-current_amd64.deb
sudo rm skype-ubuntu-current_amd64.deb
How to install Skype on a 64-bit system

The current version of Skype for 64-bit systems is a masqueraded 32-bit module. To use on a 64-bit system you might still need to install the needed packages:

sudo apt-get install ia32-libs lib32asound2 libqt4-core libqt4-gui
  • Then download and install the current Skype .deb package from the Skype website:
wget -O skype_ubuntu-current_amd64.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-64
sudo dpkg -i skype-ubuntu-current_amd64.deb
sudo rm skype-ubuntu-current_amd64.deb
  • If the 64-bit version doesn't work for you, use the 32-bit version:
wget -O skype-ubuntu-current_i386.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-32
sudo dpkg -i --force-architecture skype-ubuntu-current_i386.deb
sudo rm skype-ubuntu-current_i386.deb

Installing Skype repository

It is possible to install Skype by adding the repository and installing from there. This has an advantage of maintaining updates automatically.

  • Install the respository security key. (This requires an open port 11371 in your firewall for the keyserver.)
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 0xd66b746e
  • Add the Skype repository, update, and install Skype:
echo "deb http://download.skype.com/linux/repos/debian/ stable non-free" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt-get install skype

Wengophone

Wengophone is an integrated VOIP and videoconferencing client available on many platforms. Wengophone was initially an open-source GPL-licensed package ('Wengophone Classic'). Both the Classic version (available as a .deb file) and the current proprietary binary version are available from the website. Wengophone Classic has now been rebranded as QuteCom, however. To install the current version as an Ubuntu/Kubuntu package, see these instructions.

  • Download and install the older Wengophone Classic version (.deb package):
wget http://download.wengo.com/wengophone/rc/wengophone-0.958m-1.i386.deb
dpkg -i --force-architecture wengophone-0.958m-1.i386.deb

Gizmo5

Gizmo5 is an Internet soft-phone application, similar to Skype, that uses the SIP protocol. Install (.deb package):

wget http://download.gizmo5.com/GizmoDownload/gizmo-project_3.1.0.79_libstdc++6_i386.deb
dpkg -i --force-architecture gizmo-project_3.1.0.79_libstdc++6_i386.deb

Asterisk VOIP PBX system

Asterisk is an enterprise-grade, free open source PBX and telephony system for VOIP.

sudo apt-get install asterisk

Kiax

Kiax is an LGPL-licensed open source IAX (Inter-Asterisk eXchange) application. It is used for making VoIP calls from an Asterisk PBX. The current version must be installed from source files. See the website for download and installation instructions, or see this Ubuntu Launchpad site.

OpenSIPS / OpenSER (SIP server)

OpenSIPS is an open-source SIP server that allows connections to be made through the Internet for VoIP, IM, and other communications protocols. While there are many public SIP servers, these are subject to spoofing and other "impersonation" problems. A company may wish to host its own SIP server to avoid the problems inherent in public services whose trustworthiness can not be determined. OpenSIPS is the successor to OpenSER (which is the version in the repositories). Install OpenSER 1.3.2 from the repositories:

sudo apt-get install openser

Alternately, the newest version of OpenSIPS can be downloaded as a .deb package from the website and installed. Installation and usage instructions are on the website.

Telepathy

Telepathy is a flexible, modular communications framework that enables real-time VOIP/chat communication via pluggable protocol backends (for protocols such as Jabber/XMPP/Google Talk/Jingle, link-local XMPP, SIP, MSN, Yahoo/AIM and IRC). Telepathy is a communications service that can be simultaneously accessed by many client applications (primarily Empathy), using QT4, Glib, and GtK libraries. Currently a version for the Gnome desktop (telepathy-gnome) is available. Install:

sudo apt-get install telepathy-gnome

Web meetings

Web meeting software allows video conferencing among many clients, with one server as host.

BigBlueButton

BigBlueButton is a free open source chat/video/audio and desktop sharing platform similar to GoToMeeting, WebEx, DimDim and similar products. Developed by GoogleCode, it utilises all open-source modules. A Moodle plugin is also available. See these installation instructions and these additional detailed instructions.

WebHuddle

WebHuddle is a free, open source Java-based browser client (and server) for web meetings. To install the server, first install pre-requisites, including Java, JBOSS Application Server, and xvfb.

sudo apt-get sun-java6-jre jbossas4 xvfb

For more details on setting this up in (K)Ubuntu, see this.

TeamViewer

TeamViewer is a proprietary cross-platform package that enables up to 25 participants to share a desktop for online meetings and provides a mechanism for users to control a PC's desktop remotely. Presentations can be viewed through most Internet web browsers, as well. A free .deb package can be downloaded here.

Privacy

An interesting perspective on Internet privacy techniques can be found here.

PGP (Message Encryption)

PGP (OpenPGP and GnuPG) is a tool to encrypt your messages (such as email) to be unlocked only by someone who has a key to unlock it.

Enigmail with Thunderbird

By far the easiest method for encrypting email is using the Enigmail add-on for the Thunderbird email client. It creates PGP key pairs, stores and retrieves keys from keyrings, and encrypts and decrypts messages automatically.

Seahorse

Seahorse is the GUI for Gnome to manage the key pairs and other options of GnuPG. It can also manage your SSH keys. For more info see this tutorial. Run:

Menu -> Applications -> Accessories --> Passwords and Encryption Keys

Web browsing

Web tracking, scripts, and advertisements are extremely intrusive on the Internet. A dossier of your online habits is created by a multitude of services, including every major portal such as Google and Yahoo, as well as a variety of tracking services on the Internet. This is accomplished through the use of the "cookies" in your browser and by a variety of web elements (sometimes called "web beacons") embedded on the web pages you visit. Your behavior is monitored and correlated by recording the IP address of your computer, even when you turn off the cookies in your browser. Still, it is highly recommended to configure your web browser to erase your cookies and history every time the web browser is closed; otherwise, every website you subsequently visit can instantly see the long list of recent websites you have visited. In Firefox, for example, cookies can be accepted for the current session but erased upon closing:

Firefox -> Edit -> Preferences -> Privacy -> History -> Firefox will: Use custom settings for history
-> Always use private browsing mode (or customise the settings to your desired level of privacy)
  • In addition, both Adblock Plus and NoScript are highly recommended as plug-ins for Firefox (and other Gecko-based browsers) to limit exposure to undesirable web elements, scripts, and tracking mechanisms.

Tor (Network Privacy)

Tor is a project to allow privacy while using the Internet and to limit usage tracking. It routes your traffic through several anonymous nodes, so that your usage appears to come from an IP other than your own. (There are always risks when using the Internet that even Tor can not help with, though. Read this.) Using Tor can slow down your Internet usage significantly, depending on how much traffic is being passed through the Tor network (routine file-sharing or large downloads will also significantly reduce performance of the Tor network.)

  • Install the Privoxy http proxy:
sudo apt-get install privoxy
  • Install Tor by following the instructions here. Note that the instructions require port 11371 on your firewall to be open to use the gpg keyserver (and download the key for the debian package). Then see the Tor installation guide for details.

Vidalia (Tor interface)

Vidalia is the recommended Qt4-based GUI frontend for Tor. If not installed with Tor, install:

sudo apt-get install vidalia

Torbutton (Firefox plug-in)

Once Tor is installed and running properly, Torbutton allows you to choose whether to use Firefox through the Tor anonymizing network or not.

  • Install the .xpi extension directly from the website.
  • Torbutton intereres with several functions of Firefox, most notably the "Drag and Drop" bookmark and menu sorting functions. Disable the plugin while attempting any Drag and Drop functions, then re-enable it afterwards.

DNS Servers and Search engines

  • Most users rely on the DNS server of their ISP (Internet Service Provider). DNS queries can be recorded, however, and theoretically correlated by an ISP to the data traffic to/from a user's IP address serviced by that ISP. A somewhat less trackable solution is to use a DNS service that does not belong to your ISP. This can belong to any another commercial ISP or to a third party service such as OpenDNS, Comodo, ScrubIT, Google (though slightly less secure due to Google's own tracking mechanisms), another free DNS service, or (for maximum security) a publicly-available international DNS server. For example, a Verizon customer could use the AT&T DNS servers or the OpenDNS servers. An AT&T customer could use one of the Verizon servers or the Google servers. It is important to use a reliable DNS provider, however, as man-in-the-middle DNS redirection and DNS cache poisoning attacks are increasingly common. Stick to one of the major DNS services (just not your own ISP's DNS service).

The DNS server setting can be changed in the router's settings (recommended) or individually for each computer. If changing on an individual computer, use the Network Manager or Wicd settings, or edit /etc/resolv.conf manually and change the nameservers to the addresses you desire to use:

sudo gedit /etc/resolv.conf
  • Many search engines track your search requests (notably Google, Bing, and Yahoo) and keep logs of the searches they receive from your IP address. DuckDuckGo.com is a filtered search engine that has made its reputation not only by promising not to track searches, but also by providing a secure (encrypted), Tor-capable and anonymized search portal. Point your browser to https://duckduckgo.com. It can be used with your Torbutton turned on.
  • Many censorship/filtering/tracking techniques (that use deep packet inspection) cannot be used with secure (SSL/TLS encrypted) websites (denoted by https:// ). Use them whenever possible. For example, use the secure Wikimedia portal for Wikipedia (and other Wikimedia services) instead of the insecure portal(s).
  • Many websites keep logs of referring http headers (which can be correlated with cookies to track your browsing activities). To turn off the passage of referral headers in Firefox, see this info.

Certificate verification

  • CAcert.org is a free certifying authority that maintains weak certificates that are recognized by many open source operating systems, but not by Firefox or most browsers. (For browsers that do not include CAcert.org recognition, certificates appear to be self-signed certificates.) While Debian incorporates CACert.org's root certificate by default, Ubuntu derivatives do not (Canonical was originally founded with funds earned from Thawte, a certifying authority founded by Mark Shuttleworth.)

Proprietary Extras

Proprietary software helps you maximize your Internet experience, but is not open source. The software available includes Multimedia Codecs, Java Runtime Environment, and plug-ins for Firefox.

Restricted Extras

The Ubuntu Restricted Extras will install Adobe Flash Player, Java Runtime Environment (JRE) (sun-java-jre) with Firefox plug-ins (icedtea), a set of Microsoft Fonts (msttcorefonts), multimedia codecs (w32codecs or w64codecs), mp3-compatible encoding (lame), FFMpeg, extra Gstreamer codecs, the package for DVD decoding (libdvdread4, but see here for info on libdvdcss2), the unrar archiver, odbc, and cabextract. It also installs multiple "stripped" codecs and avutils (libavcodec-unstripped-52 and libavutil-unstripped-49). This is a single command approach.

sudo apt-get install ubuntu-restricted-extras

Note: Installation only works completely and properly when done from the command-line Terminal. The entire package will not usually install completely from within a Package Manager.

Playing DVDs

  • See this section for information on packages needed to play DVDs.

Photos and Graphics

Manage and edit your photos, create stunning 3D drawings and graphics, or convert between formats.

GIMP (Image Manipulator)

Gimp is a powerful, full-featured, free open-source graphics and image editor, similar to Adobe Photoshop.

sudo apt-get install gimp
  • There is an extra set of brushes, palettes, and gradients for The GIMP.
sudo apt-get install gimp-data-extras
  • See these instructions to create an alpha transparency layer for any photo using Gimp.

Dia (Diagram editor)

Dia is a free open source GTK-based diagram creation program for Gnome. It is similar to Visio.

sudo apt-get install dia

Kivio (Diagram editor)

Kivio is an open source flow-chart and diagram creation program that is part of the KOffice Suite for KDE. It supports Dia stencils.

sudo apt-get install kivio

Inkscape Vector Illustrator

Inkscape Vector Illustrator is an open source drawing program similar to Illustrator and CorelDraw.

sudo apt-get install inkscape

Digikam (Photo Organiser)

Digikam is a comprehensive open source digital photo organiser and editor. Install it:

sudo apt-get install digikam kipi-plugins digikam-doc

F-spot (Photo Organiser)

F-spot is a comprehensive open source digital photo organiser and editor for the Gnome desktop. Install it:

sudo apt-get install f-spot

Google Picasa (Photo Organiser)

Google Picasa is a photo editor and organiser similar to Digikam. It allows uploads to a Google web server for online exchange. For more info, see the Picasa for Linux FAQ. A self-installing .deb file is available at Picasa 2.7 downloads.

Shotwell (Photo Organiser)

Shotwell is a new photo organiser for the Gnome desktop. See these installation instructions.

Tesseract (Optical Character Reader)

Tesseract is a command-line optical character reader. Install:

sudo apt-get install tesseract-ocr

Ocropus is a document-analysis engine that uses Tesseract. Install:

sudo apt-get install ocropus

Cuneiform (Optical Character Reader)

Cuneiform is an optical character reader. Install (multiverse repositories must be enabled):

sudo apt-get install cuneiform
  • Pdfocr is a tool to use Cuneiform for OCR and then to add the resulting text file layer back to the PDF file to make it searchable.

YAGF (Cuneiform/Tesseract GUI)

YAGF is a Qt-based GUI for Cuneiform, Tesseract, and/or XSane. Installation can be from a Debian (.deb) package from GetDeb (see these instructions as well) or by compiling from source downloaded from the original site. (Qt 4.7 or later, already the version with Oneiric, is required on your system).

Xsane (Scanning utility)

Xsane is a full-featured scanning utility. Install:

sudo apt-get install xsane

Gnome-Scan (Scanning Utility)

Gnome-Scan is a simple utility for scanning (still in alpha stage). Install:

sudo apt-get install gnomescan

Gwenview (Image Manipulator)

Gwenview is the quick image manipulator installed by default in Kubuntu (K menu -> Graphics -> Gwenview Image Viewer). Simple cut-and-paste, resizing, and format conversion are some of the graphics files manipulations that can be accomplished. Install:

sudo apt-get install gwenview

OpenClipart (ClipArt Library)

OpenClipart is a utility to provide access to a large library of free PNG, SVG, and OpenOffice clipart. It includes a utility for OpenOffice Gallery. Files are installed to /usr/share/clipart. Install:

sudo apt-get install openclipart

It is also possible to only install a single collection (openclipart-png, openclipart-svg, or openclipart-openoffice.org) in case you don't want the entire collection (or the utilities). For example:

sudo apt-get install openclipart-png

Screencasts and Desktop Recording

Several utilities allow you to capture your desktop (and then create a screencast from it).

FFMPEG with x11grab

FFMPEG includes x11grab, a module for screen capture. This method gives the best results for screencaptures and is one of the most flexible methods, allowing a variety of audio inputs and audiovisual output formats. FFMPEG must be installed first (sudo apt-get install ffmpeg). See here for more details. In brief, an example command to capture to an .avi file using the X264 video codec and lossless 16-bit sound would be:

ffmpeg -f alsa -ac 2 -ab 192k -i pulse -f x11grab -s 1024x768 -r 30 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 /home/user/capturedvideo.avi

recordMyDesktop (Desktop Session Recording)

recordMyDesktop is a desktop recording utility, which has both pyGTK and a pyQT4 GUI frontends available. Recordings are saved in Theora video/Vorbis audio files. Only the Gtk version is available from the repositories (but it works well with KDE/Kubuntu nevertheless). To install with the gtk GUI:

sudo apt-get install gtk-recordmydesktop

Using recordMyDesktop with PulseAudio

  • If you have not installed Pulse Audio Controls and Volume utility, they are useful for monitoring your pulse audio devices:
sudo apt-get install pavucontrol paprefs padevchooser
  • Change the recordMyDesktop settings so that the capture device is the one you select through pulse audio:
gtk-recordMyDesktop -> Sound Quality (ticked) -> Advanced -> Sound -> Device: pulse

This sets recordMyDesktop to use whichever input device(s) are selected through pulse audio. If you have several input devices, all of them will be recorded. This is an easy way to mix inputs.

Istanbul (Desktop Session Recording)

Istanbul is a desktop recorder for the Gnome desktop. It records your session into an OGG Theora video file.

sudo apt-get install istanbul

xvidcap (Desktop Session Recording)

xvidcap is a utility to capture your desktop as a video. Install:

sudo apt-get install xvidcap

WebCamStudio

WebCamStudio creates a virtual webcam that can mix several video sources together and can be used for live broadcasting. See the website for installation instructions.

Wink (Presentation Editor)

Wink is a open source tutorial and presentation editor. It allows you to capture screenshots and use them for presentations. Download the .tar.gz source package, install using these instructions, and follow one of the user guides.

wget -O winkcurrent.tar.gz http://www.digital2b.com/mirror_wink/wink15.tar.gz

Note: Wink is a 32-bit application. If you are running a 64-bit system, make sure ia32-libs is installed first:

sudo apt-get install ia32-libs

Freeseer (Presentation capture)

Freeseer is a utility to capture output from a projector or other display device (including another computer). See these installation instructions.

Screencast Demos

rtmpdump (Capture streaming video)

Rtmpdump allows the capture of many types of streaming video. Current installation instructions are at the website.

  • Here are old installation instructions:
sudo apt-get install build-essential checkinstall libssl-dev
wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz
tar xvf rtmpdump-2.3.tgz
cd rtmpdump-2.3
make SYS=posix
sudo checkinstall
sudo ldconfig

When prompted during installation, name the package rtmpdump.

Video Applications

Capture, record, edit, and convert video using these applications. Also see this list of open source video applications. Trivia: The movie Avatar was created at Weta Digital on a super-computer comprised of 4,000 servers running Kubuntu Linux, co-ordinated by the open-source Sun Grid Engine.

OpenShot

OpenShot is a GTK-based non-linear video editing suite for Linux. Install:

sudo apt-get install openshot

PiTiVi (Non-linear Video Editing Suite)

PiTiVi is a simple, limited-capability open source video editor that will be the default in newer versions of Ubuntu. It uses the GStreamer/Fluendo framework. Install:

sudo apt-get install pitivi

Avidemux (Video editor/processor)

Avidemux is a free, GPL-licensed open source cross-platform video editor and processor. Using mencoder as a backend, it allows cropping, trimming, special effects, and conversions between many filetypes (MPG/DVD, AVI, MP4, ASF). Install the GTK-based version:

sudo apt-get install avidemux

Kino (Non-linear Video Editing Suite)

Kino is a widely used GUI-based non-linear video editing suite for Linux. It imports video files into (and then uses) the DV (Digital Video) format for editing.

sudo apt-get install kino mjpegtools

KdenLive (Non-linear Video Editing Suite for KDE)

Kdenlive is a GUI-based non-linear video editing suite for KDE based on FFmpeg and the MLT video framework. It has tools for DV, video4linux, and screen capture. Install:

sudo apt-get install kdenlive mjpegtools

Cinelerra (Non-linear Video Editing Suite)

Cinelerra Community Version is a complete high-end open source video editing suite that is a derivative of a similar commercial system. Follow the installation instructions for Ubuntu.

LiVES (Video editor/processor)

LiVES is a free, GPL-license open source video editor and processor that is promoted as being useful for VJ editors. Install:

sudo apt-get install lives

OpenMovieEditor

OpenMovieEditor is a free, open source movie editing program for basic movie making. Install:

sudo apt-get install openmovieeditor

Blender

Blender is a free GPL-licensed 3D graphics and modeling tool that has been used in several animation projects. Install:

sudo apt-get install blender

Stopmotion (Animation)

Stopmotion is an open-source program for creating stopmotion animation. Install:

sudo apt-get install stopmotion

Animata (Animation)

Animata is an interactive-animation (similar to Flash video) design platform that uses the fltk libraries. It is built from source using the SCons package (which is a make replacement).

  • Make sure you have the usual components for compiling from source code installed:
sudo apt-get install ia32-libs build-essential linux-headers-$(uname -r) gcc cmake gettext
  • Install the fltk and scons libraries:
sudo apt-get install libfltk1.1 libfltk1.1-dev scons
  • See these details. Download the Animata source code, extract, and then from the directory into which Animata was extracted run scons:
scons

Webcam Applications

  • To display your webcam on your screen, take photos from it, or to create other effects, install one of these webcam applications:
  • Cheese (sudo apt-get install cheese) is a Gnome-based webcam application with many options and a re-sizable window.
  • Kamoso (sudo apt-get install kamoso) is a KDE-based webcam application.
  • Camorama (sudo apt-get install camorama) is a Gtk-based webcam application that has been around for years.
  • Xawtv (sudo apt-get install xawtv) is a Gtk-based application. Because the Xawtv window can be arranged so that only the webcam image is shown, it is my favorite webcam display for screencasts. (Click on "X" in the window bar -> Advanced -> No Border (ticked) .)

Any of these applications can be used in either Ubuntu or Kubuntu.

Audio Applications

Audacity (Audio Editor and Recorder)

Audacity is the leading cross-platform free open source (GPL-licensed) audio recorder and editor. It can be used to record, splice, edit, and manipulate sound files similar to tools found in recording studios. Install:

sudo apt-get install audacity

Ardour (Digital Audio Workstation)

Ardour is a free, GTK-based professional-grade digital audio workstation for high end audio manipulation and mixing. Install:

sudo apt-get install ardour

Rosegarden (Digital Audio Workstation)

Rosegarden is a midi/audio interface for synthesizers, as well as a digital audio studio for recording, editing, and notating music. It is often used in combination with Audacity. Install:

sudo apt-get install rosegarden

Hydrogen (Drum synthesizer)

Hydrogen is an advanced drum machine for Linux. Install:

sudo apt-get install hydrogen

EasyTag (ID3 editor)

EasyTag is a utility for editing the ID3 tags of mp3 and other music files. Install:

sudo apt-get install easytag

Run:

Applications -> Sound & Video -> EasyTAG

PuddleTag (ID3 editor)

PuddleTag is a comprehensive utility for editing the ID3 tags of mp3 and other music files. Install:

sudo apt-get install python-qt4 python-pyparsing python-mutagen python-configobj python-musicbrainz2
wget -O puddletag_current.deb http://sourceforge.net/projects/puddletag/files/puddletag_0.9.12-1_all.deb
sudo dpkg -i puddletag_current.deb

UbuntuStudio (Ubuntu distribution customized for multimedia editing)

UbuntuStudio is an official derivative of Ubuntu that pre-packages many multimedia editing packages. (Each of the packages can also be installed independently.) See the website for a full list of the premier audiovisual software packages available for Ubuntu Linux.

sudo apt-get install ubuntustudio-audio
sudo apt-get install ubuntustudio-video
sudo apt-get install ubuntustudio-graphics

Audio / Video conversion

Here is a nice review of some of the applications that enables conversion and handling of these types of files. Some specific examples and suggestions are here.

FFMPEG video / audio conversion

FFMPEG is the swiss-army knife of video and audio format conversion. It succeeds when no other program can. It is free and open source. If it not yet installed on your system as part of another package (it is used by many video/audio editors), then install it:

sudo apt-get install ffmpeg

Example: To convert a saved Flash video (.flv) to an MPEG-2 format playable on a DVD, convert:

ffmpeg -i samplevideo.flv -target ntsc-dvd samplevideo.mpg

Then use K3b (or Gnomebaker) to write the mpg file to a New DVD Data Project.

  • For PAL use -target pal-dvd. For widescreen, use -target film-dvd. For other conversion tips, see this forum. (Note: Most Flash video has very low resolution, with a screen size of 360x270, for example. You may see a slight diminishment in resolution if you wish to convert it to 720x480 (which is the NTSC standard size) or other screen size. You can keep the original screen size and resolution by omitting the -target parameter.) If your original file is 16:9 widescreen and you desire a 4:3 letterbox output for playing on an overscanned TV, you may need to pad the file so that the widescreen is not compressed (see this forum):
ffmpeg -i samplevideo.flv -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58 samplevideo.mpg
  • You can also use the WinFF GUI and add the command (as above) as a "Preset," for subsequent use. For example:
Video converter (WinFF) -> Edit -> Presets ->
Preset Name: Letterbox -> Preset Label: 16:9 Widescreen to 4:3 Letterbox
Preset command: -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58
Ouput file extension: mpg -> Category: DVD
-> Add/Update -> Save
  • To convert to MPEG-4 (mp4) files, use
ffmpeg -i samplevideo.flv outputvideo.mp4
  • FFMpeg requires that multiple restricted extra codecs be installed. This can be done in a single easy step from the command-line Terminal:
sudo apt-get install ubuntu-restricted-extras
FFMPEG GUI

WinFF is a free, GPL-licensed open source GUI frontend for FFMPEG. Install:

sudo apt-get install winff xterm

Run:

Menu -> Applications -> Sound & Video -> WinFF
Join video segments

Individual video segments (MPEG-2, for example) can easily be joined:

cat samplevideo1.mpg samplevideo2.mpg samplevideo3.mpg > samplevideo123.mpg
You can then write the resulting MPEG-2 file to a DVD and play it in most DVD players.
Split a file into segments

Any file can be split into segments using the Linux command:

split -b 1440k my_big_file

which will split my_big_file into equal segments of size 1440 kb.

Mencoder

Mencoder is part of the MPlayer set of libraries (that also uses several of the FFMPEG libraries) for audio/visual conversion. Some examples of usage are here.

Save any streaming Flash video

An easy way is to install the Video Download Helper plug-in for Firefox.

Otherwise, most Flash videos download to the /tmp directory while you watch the video, creating a randomly-named video file there (such as Flashuh4G6s). When you close the webpage, this file in the /tmp directory will be erased. After the entire video has downloaded, but before you close the webpage, copy that file (such as Flashuh4G6s) to your home directory (where it will not be erased). Of course, for this to work, you must change your Flash (or Gnash) settings to allow an unlimited buffer. While watching your Flash video, right click to bring up the Flash -> Settings window. Set the Buffer to "Unlimited."

Once you have copied the file, rename it appropriately with the .flv added to the filename. You can then watch it using VLC or Mplayer.

Here is another method that involves making a symbolic link.

Save rtmp / flv streams

flvstreamer is a command-line application to dump rtmp streams. Install:

sudo apt-get install flvstreamer

Example of usage:

flvstreamer -r "rtmp://host/dir/file.flv" -o filename.flv

If you see the following the "WARNING: Download may be incomplete, try --resume!" message, try to use the --resume option:

flvstreamer -r "rtmp://host/dir/file.flv" -o filename.flv --resume

Convert Flash video audio to mp3

Once you have downloaded flash video content (.flv) from the Internet (using the Video Download Helper plug-in for Firefox, for example), the audio component can be converted to an mp3 using this command (from the command line Terminal). (This will work for any type of video file, not just Flash.)

ffmpeg -i nameofvideoclip.flv -ab 160k -ac 2 -ar 44100 -vn nameoffile.mp3

where -i indicates the input, -ab indicates the bit rate (in this example 160kb/sec), -vn means no video ouput, -ac 2 means 2 channels, -ar 44100 indicates the sampling frequency. See FFMPEG docs for more info.

2ManDVD

2ManDVD is a GUI utility for creating DVD videos. It is the successor of ManDVD. Choose the version for your architecture and install it from the 2ManDVD website. Click on the download link and select to open it with the GDebi Package Installer (default). (If you have previously installed ManDVD you must uninstall it first.) For a usage tutorial, read this 2ManDVD guide.

Run:

Menu -> Applications -> Sound & Video -> 2ManDVD

DeVeDe

DeVeDe is a program to create video DVDs and CDs suitable for home players (i.e. VCD, sVCD or CVD) from any source video file that is supported by MPlayer. Choose the version for your architecture and install it from the DeVeDe website. Click on the download link and select to open it with the GDebi Package Installer (default). For a usage tutorial, read this DeVeDe guide.

Run:

Menu -> Applications -> Sound & Video -> DeVeDe

ManDVD

ManDVD is a QT-based DVD authoring tool which accepts several different file types as input. Install:

sudo apt-get install mandvd xine-ui

DVD Author

DVD author allows you to create menus and format your MPEG-2 videos onto a DVD disc so that you can play it in a commercial DVD player. DVD Author is a command line tool, but several GUI's exist. Install:

sudo apt-get install dvdauthor
QDVDAuthor

QDVDAuthor is a Qt-based GUI for DVD Author. A package for Oneiric does not exist, but the Maverick package can be used.

  • Enable the Maverick multiverse repository temporarily by adding it to the Synaptic Package Manager Origin of Packages ("Other" software):
Menu -> System -> Synaptic -> Settings -> Edit Origins -> Software Sources: Other Software -> Add...
deb http://us.archive.ubuntu.com/ubuntu maverick multiverse
  • From the Get and Remove Software menu (of Synaptic), install the qdvdauthor package (and the qdvdauthor-common package if it is not automatically installed as a dependency).
  • Once the download/installation is complete, disable the Maverick multiverse repository (to prevent conflict with other Oneiric packages).
  • Download and install the addons:
cd /tmp
wget http://qdvdauthor.sourceforge.net/data/masks.tar.bz2 -O masks.tar.bz2
wget http://qdvdauthor.sourceforge.net/data/buttons.tar.bz2 -O buttons.tar.bz2
wget http://qdvdauthor.sourceforge.net/data/alpha_trans.tar.bz2 -O alpha_trans.tar.bz2
cd /usr/share/qdvdauthor/
sudo tar -xjf /tmp/masks.tar.bz2
sudo tar -xjf /tmp/buttons.tar.bz2
sudo tar -xjf /tmp/alpha_trans.tar.bz2 

Run:

Menu -> Multimedia -> QDVDAuthor

Follow instructions in the Quick-Start Guide:

QDVDAuthor -> Help -> Quick-Start Guide

For a tutorial on authoring DVDs, see this guide.

ToVid

ToVid is a collection of tools to create a DVD from a number of different video formats. A GUI is available. Install:

sudo apt-get install tovidgui tovid

Other DVD authoring programs

There are several other DVD authoring programs. For additional information see the Ubuntu Community pages. Packages include:

  • Bombono, a GTK-based, GUI DVD authoring program. Install (requires multiverse repositories to be enabled):
sudo apt-get install bombono-dvd
  • KMediaFactory is a KDE-based DVD authoring frontend for dvdauthor. (The DVD folders can then be burned to disc using K3b.) Install (requires multiverse repositories to be enabled):
sudo apt-get install kmediafactory

Ripper X CD Ripper/Encoder

Ripper X is a GTK-based (i.e. Gnome) open source utility to rip CD audio tracks to OGG, MP3, or FLAC formats. It supports CDDB lookups.

sudo apt-get install ripperx

Asunder CD Ripper/Encoder

Asunder is a GTK-based open source CD ripper/encoder which saves to Wav, MP3, OGG, FLAC, or WavPack. Self-installing .deb packages are available here.

Audex CD Ripper/Encoder

Audex is a port to KDE4 of the KAudioCreator package used in KDE 3. It can create output for LAME (MP3-compliant), OGG Vorbis (oggenc), FLAC and RIFF WAVE. Install:

sudo apt-get install audex

Gnac (GNome Audio Converter)

Gnac (GNome Audio Converter) converts between all GStreamer supported audio formats. It is not yet part of the standard repositories. See these installation instructions.

SOX (encodes/decodes audio)

SoX is a command-line utility to convert audio formats. See this usage guide. Install:

sudo apt-get install sox

Run:

sox
Install MP3 support for SoX
  • Install the MP3 libraries (if not already installed):
sudo apt-get install libmp3lame0
  • For simple conversions, I have found FFMPEG to be easier, and FFMPEG already has mp3 support. Example:
ffmpeg -i audiofile.m4a -ab 128k -ac 2 -ar 44100 audiofile.mp3
where -ab specifies the bit rate, -ac specifies the number of channels (in this example 2-channel stereo), and -ar specifies the sampling frequency.


CDs and DVDs

Brasero (CD/DVD burner)

Brasero is a CD/DVD burning application that is now part of the Gnome desktop (but can be used with any Ubuntu derivative). If not already installed:

sudo apt-get install brasero

Gnomebaker (CD/DVD burner)

Gnomebaker has been the default CD/DVD burning application for the Gnome desktop. If not installed:

sudo apt-get install gnomebaker

K3b (CD/DVD burner)

k3b (KDE Burn Baby Burn) is the default KDE CD and DVD burning utility included in Kubuntu, but can run well in Gnome. (Due to licensing requirements, mp3 capabilities must be installed separately as the libk3b6-extracodecs package). Install:

sudo apt-get install k3b libk3b6-extracodecs

Normalize audio levels

Volume normalization for an audio CD requires a separate external plugin. Install:

sudo apt-get install normalize-audio

Then select normalization:

K3b -> Project -> Properties -> Advanced -> Settings:Normalize volume levels (ticked)
  • Recent versions of k3b have a bug that doesn't properly recognise normalize-audio. See these tips (or these tips) for a workaround.

Cdrecord troubleshooting

Cdrecord error 254

Note: The solution here has not been verified, and the problem may lie in a different module than cdrkit, such as libdvdread. This section is under construction.

The problem usually occurs when a large amount of data (around 3.5 GB or larger) is being written to a DVD-R. The wodim 1.11 (there seem to be no problems with older versions of wodim such as v1.9) and genisoimage packages from the cdrkit (or one of their dependencies) used by Debian-based distributions (including (K)Ubuntu) may be dysfunctional and may generate a message similar to "cdrecord error 254" error while burning using K3B. Alternately, any file(s) written above the 3.5 GB limit may be improperly written to DVD.

  • This effectively limits DVD-R burning to less than 3.5 GB. One suggested solution entails installing a current copy of cdrtools manually. One location for obtaining cdrtools .deb packages is this Launchpad PPA repository. Download and install the cdrecord .deb package for your OS type (i386 or amd64). mkisofs and cdda2wav should be installed as well, as indicated here.
  • Solution: Do not use the cdrecord (which includes wodim) for writing DVD disks that contain more than 3.5 Gb data. Instead, use growisofs:
k3b -> Burn -> Writing app: growisofs -> Writing mode: DAO
this has successfully allowed me to burn DVDs with more than 3.5 Gb data.
  • Alternatively, obtain and use the older version of k3b/cdrecord/wodim (v1.9), such as used in the Lucid Lynx. This is not an easy solution to implement other than by installing a standalone Lucid Lynx OS in its own small partition.

Cdrecord has no permission to open the device error

If you receive the "cdrecord has no permission to open the device" error while burning using K3B, open a terminal and type:

 sudo chmod 777 /dev/scd0
Note: replace /dev/scd0 with your own device, e.g. /dev/sr0.
Note: chmod 777 is the universal option for granting full permission to a folder. The 777 mask indicates that read, write, and execute permission is given to all users.

DVD Playback Capability

libdvdcss

To play encrypted DVDs, the libdvdcss2 package is essential. libdvdcss2 is a simple library designed for accessing DVDs like a block device without having to bother about the decryption. More information about this package can be found at VideoLAN.

  • You can install libdvdcss2 as a 64-bit .deb package without installing the Medibuntu repositories:
wget -c http://packages.medibuntu.org/pool/free/libd/libdvdcss/libdvdcss2_1.2.10-0.3medibuntu1_amd64.deb
sudo dpkg -i libdvdcss2_1.2.10-0.3medibuntu1_amd64.deb
or a 32-bit .deb package:
wget -c http://packages.medibuntu.org/pool/free/libd/libdvdcss/libdvdcss2_1.2.10-0.3medibuntu1_i386.deb
sudo dpkg -i libdvdcss2_1.2.10-0.3medibuntu1_i386.deb
  • You can also use guidelines provided at Medibuntu. This will install the Medibuntu repositories on your system and then install the libdvdcss2 package:
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list
sudo apt-get update
sudo apt-get --yes --allow-unauthenticated install medibuntu-keyring
sudo apt-get update
sudo apt-get install libdvdcss2
  • You can also install 32 bit or 64 bit Windows multimedia codecs (if you haven't already done so using ubuntu-restricted-extras):
sudo apt-get install w32codecs
or
sudo apt-get install w64codecs
  • Instead of downloading directly from Medibuntu, you could also use the script included with the libdvdread4 package to download and install libdvdcss2:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh

libudf

Many newer DVDs use the UDF filesystem. To play them properly, also install libudf:

sudo apt-get install libudf0

Other tools are useful:

sudo apt-get install udftools libudf-dev

K9copy (DVD Ripper)

K9copy is the free open source DVD backup, copying, compression, and authoring utility that requires libdvdcss. For other info, see this or this guide. You can easily create MPEG-2. MPEG-4, or DVD videos with this utility.

sudo apt-get install k9copy
  • See this section for tips on using k9copy with mencoder and NTFS DVDs.
  • Tips: At times you may not be able to copy your DVD directly from DVD to DVD. This may because you have a small imperfection in the DVD, or because the DVD was initially created with a non-standard burning method. There are two methods that can help solve this problem:
  • Copy the VIDEO_TS and AUDIO_TS folders from your original DVD directly to your hard drive. Then use k9copy to burn a DVD directly from these hard drive folders.
  • Use k3b (or Gnomebaker) to copy an .iso image from the original DVD to your hard drive. Then use k9copy to extract from the hard drive .iso image and then burn a DVD directly from it.

Handbrake

Handbrake is a GPL-licensed open source tool for converting DVD to MPEG-4 (iPod format) that is an alternative to k9copy. (It can handle many DVDs that k9copy cannot.) Note that Handbrake supports X264/H.264 and MP4 encoding but no longer supports the XVID video codec. It uses the .MP4/.M4V or .MKV containers, but no longer supports the .AVI container. However, it uses a streaming algorithm that (while slower than other methods) is compatible with a large variety of encryption techniques. (Following "ripping" from a DVD, the resulting .MP4 or .MKV file can be converted to other formats, such as .AVI with XVID, using these suggestions.) Installation is from the developmental PPA archive.

sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-gtk handbrake-cli

If you do not intend to use the command-line interface, you can skip handbrake-cli.

  • Alternatively, to your package manager you can add the custom repository:
deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu oneiric main

then install the package handbrake-gtk (and handbrake-cli if desired).

dvd::rip

dvd::rip is a DVD backup/copy program, written in GTK-based perl, that uses the transcode and ffmpeg video/audio processing and conversion tools. See the website for installation and official documentation. For other info, see this dvd::rip tutorial. Install:

sudo apt-get install dvdrip rar

Acidrip

Acidrip is a DVD backup/copy program, written in GTK-based perl, that uses the Mplayer and Mencoder video/audio processing and conversion tools (and therefore yields the best quality DVD rips to an .AVI file with XVID video, for example). See the website for installation and official documentation. Install:

sudo apt-get install acidrip

DVD Fab (DVD Ripper)

DVD Fab is the favoured DVD backup tool for today's DVD encryption methods. It must be run in Wine (since it is a Windows application). It comes as a fully featured 30-day trial, but see these instructions for fine-tuning the trial period.

Music Players

Rhythmbox

Rhythmbox is the default music player in Ubuntu (Gnome), relying on the Gstreamer framework.

Play Internet Radio through Rhythmbox

Internet radio can be played through Rhythmbox by installing the rhythmbox-radio-browser plugin:

sudo apt-get install rhythmbox-radio-browser
  • Restart Rhythmbox and select the plugin:
Rhythmbox -> Edit -> Plugins -> Internet radio station browser (ticked) -> Library -> Radio browser

Note: Internet radio streams use many different ports. You must adjust your firewall to allow the ports over which the streams will be sent.

XMMS2

XMMS2 is a compact, fast GTK-based music player that is a fork of XMMS. It resembles WinAmp2 and can use the "Classic" WinAmp2 / XMMS skins. Volume normalization (using ReplayGain) is an option using a plug-in. It supports many other plugins and is ideal for streaming content. Install:

sudo apt-get install xmms2

Audacious

Audacious is a compact, fast GTK-based music player that is a fork of XMMS. It resembles XMMS2 and WinAmp2 and can use the "Classic" WinAmp2 / XMMS skins. Volume normalization (using ReplayGain) is a built-in option. It supports many plugins and is ideal for streaming content. Install:

sudo apt-get install audacious

You can switch between the "PulseAudio Output Plugin" and the "ALSA Output Plugin" under

Audacious -> Preferences -> Audio -> Current output plugin.
  • There are many places to get .wsz skins ("Classic" Winamp2/XMMS) that are compatible with Audacious, XMMS2, or QMMP:

QMMP

  • QMMP is a compact, fast Qt-based music player similar to XMMS2, Audacious, and WinAmp2 and can use the "Classic" WinAmp2 / XMMS skins. Volume normalization (using ReplayGain) is a built-in option. It supports many plugins and is ideal for streaming content. Install:
sudo apt-get install qmmp

You can switch between the "PulseAudio Output Plugin" and the "ALSA Output Plugin" under

QMMP -> Settings -> Audio -> Current output plugin.

Amarok

Amarok is the default music player in Kubuntu. Install:

sudo apt-get install amarok

Amarok themes

Amarok themes can be downloaded from KDE Look and installed.

  • Download the theme (ending in .tar.bz2) to your home directory (or chosen directory).
  • Amarok -> Settings -> Appearance -> Install New Style
  • Select the downloaded file.

Play Shoutcast Internet Radio through Amarok

Shoutcast internet radio can be played through Amarok 2.2 or later by installing the Shoutcast script:

Amarok -> Tools -> Script Manager -> Get more scripts -> Order by:Rating (ticked) -> Shoutcast service -> Install -> Restart Amarok -> Tools -> Script Manager -> Shoutcast service tralala (ticked) -> Ok -> Internet -> Shoutcast service tralala

Note: Internet radio streams use many different ports. You must adjust your firewall to allow the ports over which the streams will be sent.

Banshee Music Player

Banshee is a Gstreamer, Mono and Gtk-based music player for Linux and Mac OS X. It supports multiple mp3 players (including the iPod).There are plugins for podcasts, internet radio, and more.

sudo apt-get install banshee

Exaile Music Manager and Player

Exaile is a GTK-based music player that supports many formats, incorporates a Shoutcast directory, a plugin for iPod, Last.FM support, tabbed playlists, and other features. Install:

sudo apt-get install exaile

Songbird Music Player

Songbird is an open source music player from Mozilla with an appearance meant to resemble iTunes. It is in current development and does not yet have full support for mp3 players (such as the iPod). It incorporates a Shoutcast internet radio interface. The current beta version can be downloaded from the website.

aTunes

aTunes is a Java-based player designed to be similar to iTunes. Installation instructions are here.

Multimedia Players

Most current video multimedia players play many video formats, including the Flash video .flv format.

MPlayer Multimedia Player

Mplayer is a video player with a wide range of formats supported (including RealMedia and Windows-codecs) and a wide variety of outputs.

sudo apt-get install mplayer

SMPlayer

SMPlayer is an enhanced frontend for MPlayer.

sudo apt-get install smplayer

Dump a video stream to disc

You can dump a video stream to disc using Mplayer:

mplayer -dumpstream streamurl

If you don't know the exact URL of the stream you wish to save, you can discover it from the webpage it is embedded in by using the Firefox add-on UnPlug. Do not save streams that are illegal to download.

VLC Multimedia Player

VLC is a cross-platform multimedia player that supports many formats without need for additional codecs. It can not only receive video streams (also see here to convert it to mp4), but can act as a server for video streams, as well. It is one of the only players that can view and backup almost any DVD format, no matter which copy protection is used. See these tips for using VLC to backup/rip encrypted DVDs.

sudo apt-get install vlc vlc-plugin-pulse

VLC plugins

There are many VLC plugins. You will likely only need to install a few of them, however, depending on your hardware and input/output configuration:

sudo apt-get install vlc-plugin-ggi vlc-plugin-jack vlc-plugin-pulse vlc-plugin-sdl vlc-plugin-svgalib mozilla-plugin-vlc vlc-plugin-esd


Xine-UI Multimedia Player

Xine UI is a multimedia player based, of course, on the xine platform. It can also play streamed video from the Internet and supports most formats, including some uncommon ones.

 sudo apt-get install xine-ui

Kaffeine Video Player

Kaffeine is the default video player in Kubuntu. Install:

sudo apt-get install kaffeine

RealPlayer 11 Multimedia Player

The Linux Realplayer is actually based on the open-source Helix player. Helix itself can be installed as a package easily (read Helix plug-in) and used instead of Realplayer. These instructions are to install the proprietary version of RealPlayer only.

Download Real Player official linux player

Open a terminal and cd to the directory you have downloaded realplayer's .bin file. Then issue the following commands

chmod +x RealPlayer11GOLD.bin
sudo ./RealPlayer11GOLD.bin

When it asks for installation path enter /usr/local/RealPlayer

For all other questions just choose default by pressing enter.

If you have installed mozilla-mplayer package you will need to delete the mplayer firefox plugin for real player videos. Other wise all real player files will open with mplayer. For that please do this

cd /usr/lib/firefox/plugins
sudo rm mplayerplug-in-rm.*

Please remember to restart firefox and when ever you click on a real player video choose the option open with and use /usr/bin/realplay

Internet TV

Miro Player

Miro Player (formerly Democracy TV Player) is an open-source Internet TV and video player that allows you to watch Internet TV and videos. Unlike other video players, it contains a structured guide that includes more than 2500 channels, has built-in BitTorrent, and has features that can automatically save videos, such as from YouTube.

sudo apt-get install miro

Myth TV

See MythTV

Sopcast Internet TV

Sopcast is an interface to play live P2P video streams through the VLC media player. Install VLC first. This is a Chinese program and most content is hosted in China and may not be legal in your area. Please consult local regulations.

You can install the SopCast Player PPA using the following commands:

 echo "deb http://ppa.launchpad.net/jason-scheunemann/ppa/ubuntu `lsb_release -cs` main" | sudo tee -a /etc/apt/sources.list
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CD30EE56 

If you are using Karmic or later:

sudo add-apt-repository ppa:jason-scheunemann/ppa
sudo apt-get update
sudo apt-get install sopcast-player

Run:

Applications->Sound & Video->SopCast Player

Zattoo

Zattoo is a free Internet TV player that allows you to watch terrestrial television from various countries in Europe. See the Zattoo Download page for further instructions on installation. For screenshots and an alternate installation guide, see this UbuntuGeek guide.

  • Install dependencies first:
sudo apt-get install libgtkglext1 adobe-flashplugin
 wget http://zattoo.com/release/download.php
  • Install the downloaded .deb package:
sudo dpkg -i *.deb
  • Run Zattoo:
K -> Application -> Multimedia -> Zattoo Player
Note: you have to register for a free account when the player starts.

TV Time (TV Viewer)

TVTime allows the display of television and other digital inputs (made available to the computer by a video capture card). A plugin for the Remuco remote control (remuco-tvtime) is also available. Install:

sudo apt-get install tvtime

ABC iView

Python-iView is a program that works with rtmpdump to record streams offered by ABC iView (Australia). Installation instructions are at the PPA repository.

BBC iPlayer

BBC iPlayer provides replays and downloads of BBC programs to UK residents. The BBC, however, has crippled its streams to prevent downloading and legal actions against iPlayer appear to be in progress. (Flvstreamer may be required for rtmp stream recording). To install a Flash 64-bit edition of iPlayer:

sudo aptitude remove flashplugin-installer
sudo add-apt-repository ppa:sevenmachines/flash
sudo aptitude update
sudo aptitude install flashplugin64-installer
get_iplayer (BBC program recording)
  • get_iplayer allows BBC streams (through their iplayer service) for UK users, as well as Hulu streams for US users, to be recorded to mp4, wav and mp3 files (depending on content). Install v2.66 (may not work for all users):
sudo apt-get install get-iplayer
  • To install a newer version:
sudo apt-get install flvstreamer id3v2 libmp3-info-perl atomicparsley libwww-perl perl
wget ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.79.tar.gz
tar xvf get_iplayer-2.79.tar.gz
sudo ln -s iplayer-2.79/get_iplayer /usr/bin/get_iplayer

Note: When running this version, use get_iplayer instead of get-iplayer.

  • Add preferences:
get_iplayer --prefs-add --modes=flashhd,flashvhigh,flashhigh,flashnormal,iphone
get_iplayer --prefs-add --flvstreamer "/usr/bin/flvstreamer"
  • Delete ~/.swfinfo:
cd ~/.swfinfo
sudo rm *
cd ..
sudo rmdir swfinfo
  • See the website for usage or:
man get-iplayer
  • Get a current listing of what's available and save it in the home directory
get-iplayer >~/iplayer-listing.txt
  • Having found some interesting programmes (and noted the numbers found in the left-hand column), download them:
get-iplayer --get 123 537
  • Some users will need to install rtmpdump for successful streaming.

Netflix Android App

A Netflix app for the Android market is available here. It must be installed in an Android environment.

Virtual Android OS

In Virtualbox (or QEMU, VMWare, or other virtual environment), install the Android-x86 OS using the installer burned to a CD or USB drive. Install the app.

Android SDK emulator

The 32-bit Linux Android Android emulator and SDK requires the Android SDK for Linux, ia32-libs, and sun-java6-jdk.

Internet Radio

Internet radio streams through different ports, so check your firewall if you are not able to play the streams.

Last FM

LastFM is a service for sharing music recommendations and individual radio streams. It is included as an option in Amarok, or can be installed separately:

sudo apt-get install lastfm

Shoutcast Internet Radio

Shoutcast is the first and last free mp3 streaming service. Hundreds of radio streams can be played through Amarok, Audacious, or other multimedia player. Simply associate the .pls streams with your favourite player (Audacious or XMMS2 recommended).

StreamTuner Stream Directory Browser

StreamTuner lists streams available on the Internet through a GTK-based interface. It lists Shoutcast and Live365 streams, among others. Install:

sudo apt-get install streamtuner

Streamripper

Streamripper is a standalone command-line utility to record online audio streams (primarily from Shoutcast). A GUI front-end for KDE is available. Install:

sudo apt-get install kstreamripper

Media Centers and PVR (Personal Video Recorder)

There are a number of open-source Media Centers for Linux, some of which include personal video recorder functions. For a full list of open-source media centers, see this guide.

MythTV

MythTV is a media center with PVR (personal video recorder) for retrieving, recording, and playing broadcast and Internet TV and other multimedia content. It has many options and plugins for expansion. To be useful, you will need a compatible TV tuner card. For setup tips, see this guide. Install:

sudo apt-get install mythtv

Mythbuntu

Mythbuntu is an integrated Ubuntu (Xubuntu) desktop optimised for MythTV usage. In can be used instead of adding MythTV to a Ubuntu desktop.

XBMC

XBMC is a free, mature, open-source cross-platform media center. It does not have a PVR capability nor as many functions as MythTV, but has a very nice interface.

deb http://ppa.launchpad.net/team-xbmc-intrepid/ubuntu intrepid main
deb-src http://ppa.launchpad.net/team-xbmc-intrepid/ubuntu intrepid main
  • Install:
sudo apt-get update
sudo apt-get install xbmc

Boxee

Boxee is an XBMC-like open source package to allow streaming video over the Internet, including from YouTube and other sites. It is a fork of XBMC, and is still in alpha development and testing stage. It is currently available for 32-bit systems only, and recommended for Hardy. A current version is anticipated soon. (Note: Boxee does not run Netflix on Linux, despite their ads). See these download instructions.

Elisa

Elisa is a cross-platform media center that uses the Gstreamer multimedia framework. Commercial plugins are available from Fluendo. It supports PVR and Music Jukebox . Install:

sudo apt-get install elisa

LinuxMCE

See LinuxMCE.

Multimedia Servers

MPD Multimedia Playing Server

MPD is a music server meant for LAN usage. It can be controlled from remote clients. It can also stream internet streams.

TiMidity++ MIDI Sound Server

TiMidity is a MIDI software synthesizer required by several games and other MIDI-dependent applications.

sudo apt-get install timidity

uShare UPnP A/V Media Server

uShare is a UPnP media server compatible with the Xbox360 and PS3.

sudo apt-get install ushare

Also see: How-to: Run uShare at Startup.

Home Automation / Home Theater / Home Security

Complete Systems

Linux MCE (Media Center Edition)

LinuxMCE is an integrated home theater/home security/home automation/telephone PBX/intercom system for your home. It incorporates MythTV, Pluto home automation, Motion security surveillance, Asterisk PBX, VDR video disk recorder, and other home automation/security/theater packages in an integrated platform. It is available in 32 and 64 bit versions. LinuxMCE can run either as a standalone Home Theater PC or can co-ordinate a fully networked home, using the networking capabilities that are intrinsically part of the Kubuntu Linux OS. For more info see the LinuxMCE website or wiki.

The most recent stable version runs on Kubuntu 8.04 (Hardy). A beta version for Kubuntu 10.04 (Lucid) has been released, and the full version is anticipated soon. LinuxMCE can be installed at the same time as the Kubuntu OS (on a new PC with an nVidia graphics card), with a single DVD installation. Alternatively, Kubuntu can be installed first and LinuxMCE then installed from a 2 CD installation.

Other systems in development

  • Minerva -- home automation and multimedia control with a GUI interface. It can even hook into Google Calendar.
  • DomotiGa -- home automation software from the Netherlands, using a MySQL database.
  • NetHomeServer is a Java-based cross-platform automation system authored by a single coder. It is in alpha development but can be downloaded from the website and evaluated.
  • The Wosh framework is message-based middleware to effect home automation processes. the project is in early development.
  • Linux Home Automation contains information regarding many nascent home automation projects.

Home Security

Zoneminder surveillance system

Zoneminder manages surveillance cameras and stores images on the hard disk. Images can be viewed using a (LAMP) server remotely. X10 devices can be triggered using built-in perl scripts. Install:

sudo apt-get install zoneminder ffmpeg
Myth Zoneminder

MythZoneminder allows you to view your security cameras through Myth TV, essentially. It is a plugin that interfaces the two packages Zoneminder (which must be working on your system) and Myth TV (which must also be working.) See the installation instructions. Install:

sudo apt-get install mythzoneminder

Office Suites

Open Office

Open Office is installed by default in older versions of (K)Ubuntu, with Writer (Word equivalent), Presentation (PowerPoint equivalent), Calc spreadsheet (Excel equivalent), and Base relational database (Access equivalent).

Open Word 2007 Documents in Open Office

The latest edition of OpenOffice opens .docx (i.e. Word 2007) documents by default.

LibreOffice

LibreOffice is a free and open source (GPL-licensed) office suite similar to OpenOffice. Install:

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice libreoffice-gnome

KOffice

The KOffice suite is part of the KDE project and is meant to provide the capabilities of the OpenOffice suite without the licensing restrictions of OpenOffice. It can be used in any version of Ubuntu. Install:

sudo apt-get install koffice

AbiWord

AbiWord is a fast, collaboration-enabled word processor. For the most current version see the AbiWord web site. To install from the repositories:

sudo apt-get install abiword

GoldenDict (Multi-lingual Dictionary and Translator)

GoldenDict is multi-lingual dictionary and translator that supports Babylon and StarDict translation dictionary files and has multiple modular plugins. Install:

sudo apt-get install goldendict

Xournal

Xournal is a free (GPL-licensed) GTK/Gnome-based application for notetaking, sketching, or keeping a journal using a stylus. Install (universe repositories must be enabled):

sudo apt-get install xournal

PDF Files

PDF is the file format used by Adobe Acrobat (which can be read by many e-book readers as well). There are many PDF-oriented utilities available in Ubuntu. In the Synaptic Package Manager, search for "pdf".

Print to a PDF file

(K)Ubuntu allows printing of any document to the PDF format by default. From any application:

File -> Print -> Print to File -> Output: PDF

View a PDF document

Evince is the default PDF document viewer in Ubuntu. PDF files are associated by default with Evince, so clicking on a PDF file (from a file manager such as Nautilus) will open it with Evince. Evince can also be started:

Menu -> Office -> Evince

Scan to a PDF file

Gscan2pdf is a utility to do exactly that: scan to a PDF file. Multiple options for scanning can be set. Install:

sudo apt-get install gscan2pdf

PDF-Shuffler (PDF file management)

PDF-Shuffler is a free GTK-based utility to manipulate multiple PDF files, allowing individual pages or entire PDF documents to be re-arranged, rotated, merged, or deleted. This is an essential tool for working with PDF files. Install:

sudo apt-get install pdf-shuffler
Run:
Menu -> Office -> PDF-Shuffler

MaxView (PDF file management)

MaxView is a utility to capture, manipulate and rearrange, and print .pdf and .max files. Written in Qt, it is similar in some respects to Paperport.

  • Download and install the .deb package (use i386 instead of amd64 if using a 32-bit OS):
wget -O maxview_current.deb http://sourceforge.net/projects/maxview/files/maxview0.7-2/maxview_0.7-2_amd64_maverick.deb/download
sudo dpkg -i maxview_current.deb
  • Start MaxView in a GUI by creating a menu item with the Command: maxview /home/user, where /home/user is the directory in which you wish MaxView to start.

PDFMod (PDF file management)

PdfMod is a Gnome-based application to reorder, rotate, and remove pages, export images from a document, edit the title, subject, author, and keywords, and combine documents via drag and drop. Install:

sudo add-apt-repository ppa:pdfmod-team/ppa
sudo apt-get update
sudo apt-get install pdfmod

PDFedit (PDF file editor)

PDFedit is a free (GPL-licensed), Qt-based PDF file editing and manipulation program that uses a GUI for editing. Install:

sudo apt-get install pdfedit

Import PDF files into a word processor

Import PDF files into OpenOffice Writer

PDF files can be imported into the OpenOffice Writer word processor as a hybrid document (not a scanned character document) by installing:

sudo apt-get install openoffice.org-pdfimport
Import PDF files into KWord

Kword is the Word Processor package in KOffice. It allows the importing of PDF files by default.

PDF-XChange (PDF file editor)

PDF-XChange is a free Windows-based application to view, modify, or perform simple editing of PDF files. It works under Wine.

eBooks

FBReader (e-book reader)

FBReader is a free cross-platform e-book reader, based on the GTK platform. Install:

sudo apt-get install fbreader

Calibre (eBook conversion)

Calibre is an eBook reader, library manager, and tool for conversion between many eBook formats (including the .epub format). Install:

sudo apt-get install calibre
  • eBook conversion examples and tips are here.

Sigil (eBook editing and conversion)

Sigil allows creation and editing of an eBook in .epub format and conversion from other formats. Download and install the binary from the website.

eCub (eBook editing and conversion)

eCub allows creation and editing of an eBook in .epub format and conversion from other formats. Download and install the .deb package from the website.

Personal Information Managers

Kontact Personal Information Manager

Kontact is the default PIM included with Kubuntu. Kontact includes email, an address book, a calendar, reminders, pop-up notes, a link to the Akregator News/RSS reader, time-tracking, and more. Its many functions resemble MS-Outlook. Through connectors it interfaces with many groupware servers (such as Kolab and eGroupware). Install:

sudo apt-get install kontact

Mozilla Sunbird (Calendar)

Sunbird is a standalone group calendar client that in the future will be replaced by the Lightning extension for Thunderbird and Firefox. (It is available in a 64-bit and 32-bit version, whereas the Lightning extension is currently only available in a 32-bit version.) Download from the website and install by clicking on the downloaded file to extract, or:

sudo mkdir /etc/sunbird
cd /etc/sunbird
sudo wget -O sunbird-current.tar.bz2 http://download.mozilla.org/?product=sunbird-1.0b1&os=linux64&lang=en-US
tar -xvjf sunbird-current.tar.bz2
Replace os=linux64 with os=linux if using a 32-bit OS.
  • Then create a menu item named Sunbird to point to the Command: /etc/sunbird/sunbird

BasKet Note Pads

BasKet Note Pads is a personal note-taking application that resides on your computer and can be used for creating "to-do" lists. It is great for centralising your thoughts in one place. Install it:

sudo apt-get install basket

Planner (Project planning & management)

Planner is an MS-Project-like planning and management tool.

sudo apt-get install planner

Time Tracker

You can keep track how long you use an application with TimeTracker. Keep records for billing or simply limit your Internet usage.

Financial Software

For a brief introduction, see this list of 10 Linux financial tools.

KMyMoney (Personal Finance Management)

KMyMoney is a personal finance manager that uses double entry accounting, the method professional accountants use. It is similar to MS-MyMoney and Intuit Quicken, with automatic setup of categories for businesses. It is designed for the KDE/Kubuntu desktop (but will work in Gnome/Ubuntu). Install:

sudo apt-get install kmymoney2

GnuCash (Personal Finance Management)

GnuCash is a free, open source GPL-licensed personal finance manager that uses double entry accounting like professional accountants. It is GTK-based (Gnome 2). The current version can be installed from source files (see the website for installation instructions), or the package version can be installed:

sudo apt-get install gnucash

Skrooge (Personal Finance Management)

Skrooge is a free, GPL-licensed personal finances manager written for the KDE desktop that is able to import/export data to/from many other finance managers.

sudo apt-get install skrooge

Moneydance (Personal Finance Management)

Moneydance is a commercial cross-platform Java-based personal finance manager similar to KMyMoney that sells for $50 per license.

SQL-Ledger (Enterprise Finance Management)

SQL-Ledger ERP is a free, open-source, platform independent double-accounting-method system and enterprise resource planner (inventory, work and purchase orders, taxes, etc.) that uses the SQL database server (PostgreSQL/Oracle/Mysql databases). It uses a web browser for an interface and be accessed remotely. It is extremely comprehensive and is available in many languages. Install:

sudo apt-get install sql-ledger

LedgerSMB (Enterprise Finance Management)

LedgerSMB is a fork of the SQL-Ledger project that offers fairly solid AR, AP, and GL tracking as well as inventory control. It is in rapid development and encourages community support. A Debian (.deb) package is available here.

WebERP (Enterprise Finance Management)

WebERP is a free, open-source enterprise resource planner and accounting suite similar to SQL-Ledger that uses a web browser as an interface. It runs on the LAMP server. It is somewhat difficult to implement and use, but conforms to strict accounting guidelines. Set up your LAMP server first, then install using the web site instructions.

Phreebooks (Enterprise Finance Management)

Phreebooks is a free open-source enterprise resource planner and accounting suite similar to WebERP. It also runs on a LAMP server. It is in active development in 2008. A demo is available at the website.

Quasar (Enterprise Finance Management)

Quasar is a proprietary Linux-based accounting suite similar to Quickbooks. For a single user without point-of-sale or networking needs, it is free. For other users it costs CA$500 per seat. An installer for KDE-based systems is here.

Stock Market monitoring software

  • BeanCounter - A stock portfolio performance monitoring tool. Install:
sudo apt-get install beancounter
  • Smtm - Show Me The Money is a configurable Perl/Tk stock ticker program. Written by the creator of BeanCounter.
sudo apt-get install smtm
  • Qtstalker - commodity and stock market charting and technical analysis
sudo apt-get install qtstalker

Groupware

Groupware solutions include shared calendars, group email servers, groups address lists, group projects, and internal messaging. They require (one or more) servers with LAMP or similar server stacks.

Groupware Servers

Groupware servers are meant to operate on a server platform. You should install the server version of Ubuntu (in the interest of speed) for a dedicated groupware server. Read Servers.

Kolab

Kolab is the most comprehensive open-source groupware solution available and is distributed as a multi-platform solution. (It integrates easily with both Ubuntu (including Evolution) and KDE/Kubuntu (including Kontact).) It is free and open source with a GPL license (unlike other groupware solutions), yet enterprise support is also available. It is scalable to large organizations and is Outlook (MS-Exchange) and Mozilla compatible. This is a German package, however, and documentation in English can occasionally be limited. The Kolab website provides its own instructions for installation from source (currently v. 2.2). Version 2.2 includes the Horde web interface. The current beta Debian package instructions are here or the OpenPkg installation instructions are here.

  • Note: Kolab uses its own server components, and it is best to run Kolab on a dedicated server. However, it is possible to run other servers on the same machine, as long as you choose alternate ports if the server modules conflict.
  • Install the compiler and other necessary stuff:
sudo apt-get install build-essential

Kolab Ubuntu package

  • There is an Ubuntu/Kubuntu package for the new version of Kolab (v. 2.2), but no documentation support for it yet exists. Install:
sudo apt-get install kolabd

Manual Kolab installation

  • Make a directory for the Kolab installation and make it universally accessible:
sudo cd /
sudo mkdir /kolab
sudo chmod 777 /kolab
  • Optional: If you wish to mount kolab in its own partition, then create a new partition (using Gparted, for example). Figure out the device name of your extra partition:
sudo fdisk -l
It should be something like /dev/sda3.
Mount /dev/sda3 (or whatever your partition is) as /kolab by editing /etc/fstab:
sudo nano /etc/fstab
and adding the line:
/dev/sda3  /kolab  ext3  defaults,rw 0 0
then reboot and make sure there are no errors.
  • Make a directory into which to download kolab:
cd /tmp
mkdir /kolabtmp
  • Download all the current Kolab files:
cd /tmp/kolabtmp
wget -r -l1 -nd --no-parent http://files.kolab.org/server/release/kolab-server-2.2.2/sources/
  • Install Kolab (as root using sudo -s):
sudo -s
sh install-kolab.sh 2>&1 | tee kolab-install.log
  • Reboot your system.
  • Stop Kolab services and run the configuration utility:
sudo /kolab/bin/openpkg rc all stop
sudo /kolab/sbin/kolab_bootstrap -b
Obviously, you should know all your details, such as your fully qualified host name (which you can determine from hostname -f), domain details, etc., before doing this step. If you are not familiar with OpenLDAPand LDAP basics, you should learn about it, as Kolab uses the slapd OpenLDAP server daemon.
  • Restart all Kolab services:
sudo /kolab/bin/openpkg rc all start
  • Login to the web administrator interface using "manager" and the password you set at bootstrap configuration:
https://yourhost.yourdomain.name/admin

Citadel

Citadel is a turn-key fully open source groupware solution (that is both KDE and Kolab-1 compliant). Based on a bulletin-board framework spanning over 20 years, it is user friendly and interfaces with both KDE and Gnome apps and also has a web-based client. It is also WebDAV compliant and can be used with Thunderbird.

  • Install the Citadel server:
sudo apt-get install citadel-server
  • Install the Citadel client:
sudo apt-get install citadel-client
  • Install both:
sudo apt-get install citadel-suite

eGroupware

eGroupware is a robust and stable free open source groupware solution (with GPL license) based on the LAMP stack (the default server stack included with Ubuntu Server) and the Postfix mail server (both of which should be installed first). There is a new version recently available, with a new corporate sponsor in Germany and a commercial enterprise version. Compatibility with many clients has been improved. Egroupware provides the easiest installation and quickest setup time of all groupware solutions. Much of the documentation for the current version, unfortunately, is not in English.

sudo apt-get install egroupware

Open-Xchange

Open-Xchange is a proprietary groupware solution (meant as an MS-Exchange replacement) that has released a "community edition" based on commercial versions. The latest .deb package is for Hardy Heron 8.04. It is compliant with many different types of clients, including Kontact, Outlook, and Palm PDAs. Installation instructions are at the website and are not trivial.

OpenGroupware

OpenGroupware is a groupware solution based on the postgreSQL database. There is an enterprise version and a limited open source version, and development appears to have been stagnant in 2008. Installation must be from source, as packages are very outdated. See the website for details.

Zarafa

Zarafa is the leading European MS-Exchange replacement/groupware solution. It is proprietary, but a GPL-licensed (except for trademarks) free open-source community edition was released in 2008. Download instructions are available from the website.

Zimbra

Zimbra is a proprietary groupware solution (now owned by VMWare) that offers an open source "community edition". Although currently free, the community edition is limited in features and does not have a GPL license. All submitted modifications and contributions become the property of VMWare. See the Zimbra wiki.

A Beta version for Lucid Lynx 10.04 LTS is available for 64-bit users, or the older Hardy 8.04 version can be used.

SchoolTool

SchoolTool is a free open source groupware solution for use in primary and secondary schools which includes calendaring, gradebooks, attendance records, and student information databases. It was created with the help of the Shuttleworth Foundation (which also sponsors Ubuntu). See these installation instructions.

SugarCRM Community Edition

SugarCRM is a customer-relationship management system that is used to co-ordinate a sales force (sales, marketing, support, project management, calendaring). SugarCRM has a community edition that is one of the most widely used. A LAMP server stack should be installed first ( sudo tasksel install lamp-server ). Extract SugarCRM to /var/www and then logon to http://localhost/SUGAR-FOLDER. Alternatively, for a new server SugarCRM provides a (binary) integrated installation of the LAMP stack with the SugarCRM Community Edition.

Groupware Clients

Many groupware solutions have connectors to interface with clients such as Kontact/KMail and Mozilla Thunderbird (or SeaMonkey).

Evolution Exchange

The Evolution Exchange connector adds connectivity (using Outlook Web Access) to the Evolution suite for MS Exchange 2000 and 2003. Install:

sudo apt-get install evolution-exchange

Kontact Personal Information Manager

The Kontact Personal Information Manager, included in Kubuntu by default, interfaces with many groupware servers.

KDE Groupware Wizard

Kubuntu provides a wizard (script) to help clients (such as Kontact/Kmail) connect to a groupware server. Currently supported groupware servers are Kolab, eGroupware, SUSE Linux Openexchange, and Novell Groupwise.

Zimbra Desktop

Zimbra Desktop is a desktop that collaborates with Zimbra servers. See the Zimbra Desktop FAQ. For more info also see this Ubuntu Forums Zimbra Desktop Installation thread.

Oracle Calendar Desktop Client

The Oracle Calendar Desktop Client is proprietary calendaring software for use with Oracle groupware/database systems.

Download Oracle Calendar Desktop Client:

wget http://www.k-state.edu/infotech/calendar/oracle-10-clients/DesktopClients/Linux/cal_linux_1011.tar.gz

Extract:

tar -xvf cal_linux_1011.tar.gz

Change into the extracted files directory:

cd OracleCalendar_inst/

Prepare the files:

mv cal_linux cal_linux.bak; cat cal_linux.bak | sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > cal_linux; rm cal_linux.bak

Change permissions:

chmod +x gui_install.sh cal_linux

Start the GUI installer:

sudo sh gui_install.sh

Group Calendars

DAViCal Calendar Server

DAViCal is a CalDAV, postgreSQL, Apache and php-based shared Calendar server that works with Mozilla Thunderbird/Lightning/Sunbird, Evolution, and other calendar clients. Install:

sudo apt-get install davical

Then see these detailed installation instructions.

Darwin Calendar Server

Darwin Calendar Server is an open-source port of Apple's CalDAV-based calendar server that works with Mozilla Thunderbird/Lightning/Sunbird, Evolution, and other calendar clients. Install version 1.2 from the repositories (then see the website for usage instructions):

sudo apt-get install calendarserver

WebCalendar

WebCalendar is an ICS-based server for group calendars that can use many different databases as the backend, is written in PHP, and is compatible with clients such as Sunbird/Thunderbird (Lightning), Apple iCal, and Evolution. The newest version can also be viewed using RSS clients. See the website and the wiki for installing the newest (1.2) version. Install the older (1.05) version from the repositories:

sudo apt-get install webcalendar

Mail servers

Postfix / Dovecot (Mail Server)

Postfix is a free open source mail server. It interfaces directly to Dovecot, the free open source IMAP and POP3 server. For more information see the official Ubuntu documentation. The dovecot-postfix metapackage installs the components and customizes the configuration files to use the Maildir (mail spooling) folder system by default. Imap and Pop3 modules, SMTP, and SASL/TLS (with self-signed certificates) are installed by default.

sudo apt-get install dovecot-postfix

For tips on setting up a personal mail server, see here.

iRedMail

iRedMail is an integrated package that includes Dovecot, Postfix, a choice of OpenLDAP (with phpLDAPAdmin) or MySQL for the database, Roundcubemail or Squirrelmail for web-based mail access, phpAdmin, PostfixAdmin, and AWStats. It is optimized for Lucid 10.04 LTS and is best installed on a fresh server (since it resets many email configuration files). There is a community edition with many of the features of the commercial edition.

Wiki software

Wiki software allows an organization to have a manual that can be edited by a number of collaborators. Wikipedia is the best known example.

MediaWiki

MediaWiki is the free, open source server software that Wikipedia uses. It is scalable to very large uses. It runs on the LAMP server stack (which uses the MySQL database and is available as an installation option with the (K)ubuntu server), or it can be used with a postgreSQL database. See these detailed instructions. (Other instructions are also available here.) Install from the repositories:

sudo apt-get install mediawiki
  • Edit the config file so it recognizes MediaWiki:
sudo nano /etc/mediawiki/apache.conf

Uncomment (remove the #) the line:

Alias /mediawiki /var/lib/mediawiki
  • Restart apache2:
sudo /etc/init.d/apache2 restart
  • Run/install MediaWiki by logging into:
http://localhost/mediawiki
You will be prompted for configuration variables to be set. The trickiest is the MySQL user/password. Hopefully you remember your MySQL superuser that you set at the time of LAMP (or MySQL) installation.
  • Copy your local settings configuration file to /etc/mediawiki (and make a backup of the original):
sudo cp /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki
sudo mv /var/lib/mediawiki/config/LocalSettings.php /var/lib/mediawiki/config/LocalSettings_at_install.php

Edit your configuration variables there:

sudo kate /etc/mediawiki/LocalSettings.php
  • If you are using a virtual host server, make a symbolic link (named in this example mywiki) from your /usr/share/mediawiki installation folder to your /var/www folder:
sudo ln -s /usr/share/mediawiki /var/www/mywiki

then make sure you have an apache2 virtual hosts configuration file (in /etc/apache2/sites-available) that points to /var/www/mywiki as the DocumentRoot. Make a symbolic link from your virtual host configuration file in /etc/apache2/sites-available to /etc/apache2/sites-enabled to enable it. Restart apache2 after enabling the sites. (Warning: MediaWiki is not secure at installation and can be easily hacked by new users. Do not publish your wiki to the Internet before reading all the instructions and changing the configuration file (LocalSettings.php) so that it is more secure.) You would then access the database at:

http://my.virtualwikihost.org

Twiki

Twiki is an open source wiki engine used by many small to medium size companies internally. It has an active development team with multiple plugins. See the website for installation instructions. Install:

sudo apt-get install twiki

Moin Moin

Moin Moin is free, open source (GPL-licensed) wiki software written using Python, with a large community of users, including the Apache, Debian, and Ubuntu wikis. See these Ubuntu installation instructions. Install:

sudo apt-get install python-moinmoin

TiddlyWiki

TiddlyWiki is an open source personal wiki. It is ideal for creating a list of things to do, note taking, or as a collaboration tool for a small team. It is a single HTML file that can reside on your computer or can even be uploaded to a web server and be used as a simple website. It is developed using a Firefox browser as an interface. Installation instructions are on the website.

Web Publishing

Drupal (Web content publishing)

Drupal is the leading open-source website creation and content collaboration tools. A modular approach to website building, from simple out-of-the-box websites to complex sites is possible with a short learning curve. Get more info on how to get started. Drupal requires an installation of a LAMP server stack; if you have not already installed LAMP, it will be installed along with Drupal. I have found it easier to use the MySQL database (the "M" in LAMP), but Drupal can also integrate with PostgreSQL if you have it installed.

Drupal7

Drupal7 is available as a Debian package here.

The package for your system (32-bit or 64-bit) can be downloaded and directly installed on a newer (K)Ubuntu OS, or the Debian repository can be added (as mentioned in the instructions on the download page) and then the package installed using a package manager such as Synaptic or KPackageKit.

Drupal6 (Web content publishing)

Drupal6 is available as a package, or from the command-line terminal:

sudo apt-get install drupal6
  • After everything is installed (and the problems below sorted out), restart the apache2 server:
sudo /etc/init.d/apache2 restart
  • Finish installation through your browser:
http://localhost/drupal6/install.php

You can then also see these installation tips for installing through the browser, then see these Drupal site building tips. A Drupal/Ubuntu users group is found at Drubuntu.

Installation quirks
Exim vs. Postfix

Exim and Postfix are mail handlers. I had installed Postfix at the time I installed my Ubuntu server (but was not using it). But Drupal6 uses Exim and therefore removes Postfix at installation and installs Exim instead. Therefore, it is better not to use Drupal6 on a mail server that uses Postfix.

WordPress

WordPress is a popular free open source web content manager that started as a blog tool and now incorporates many publishing elements. For bloggers and small to medium-sized websites, WordPress provides the fastest installation and customization process with many modules. WordPress requires an installation of a LAMP server stack first. Then install:

sudo apt-get install wordpress
  • Make a symbolic link from your Apache2 www folder to your installation folder and install a new MySQL database named localhost to use with WordPress:
sudo ln -s /usr/share/wordpress /var/www/wordpress
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

Note: If you already know the name of your (virtual) host URL for WordPress, then use it as the name of your database instead of localhost. For example, my URL is mysite_x.homeserve.org so my command is:

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress mysite_x.homeserve.org
  • If you will access your WordPress server through a virtual host, then create your virtual host configuration file in the /etc/apache2/sites-available folder. Once you have edited the file, make a symbolic link from it to the /etc/apache2/sites-enabled folder. Restart apache2:
sudo /etc/init.d/apache2 restart
  • Install WordPress through a browser:
http://localhost/wordpress
or, if you are using a virtual host:
http:/mysite_x.homeserve.org/wordpress

Note: The Jaunty repositories contain version 2.7.1, which is subject to a security worm. If you install this version, please update immediately to the current version from the Tools -> Upgrade menu. (Alternatively, install the current source version from the website.)

For the automatic updater to work, all the WordPress files, folders, and subfolders must be owned by www-data (which is also the owner of the apache2 process) prior to updating.

sudo chown -R www-data /usr/share/wordpress

Joomla (Web content publishing)

Joomla is a powerful open source website creation and content management tool that allows website creation for use in every arena from the simple to complex corporate environments. Info for beginners is a good place to start.

Scribus (Desktop publishing)

Scribus is an open-source package that provides professional-appearing desktop publishing.

sudo apt-get install scribus

Plone (Content Management System)

Plone is a free, open source (GPL-licensed) multi-platform content management system used by many large organizations around the world. It is available with an integrated installer here. Some users have had some difficulties in Jaunty, due to changes in Python.

Gallery (Photo album website)

Gallery is a PHP-based method of presenting a photo album on a website. A Drupal interface is also available for Gallery2. Install:

sudo apt-get install gallery2

phpBB (Forums)

phpBB is the leading open source platform for Forums. A LAMP server stack (or PostgreSQL database instead of MySQL) will be required and should be installed first. Then make sure the universe repositories are enabled and install:

sudo apt-get install phpbb3

Distance teaching

Moodle

Moodle is a free open source platform for hosting online learning courses. It can be integrated with webinar software. A LAMP server installation is required (sudo tasksel install lamp-server). Also find free Moodle themes here. Install:

sudo apt-get install moodle
  • Database server software for Moodle: mysql-server -> follow remainder of instructions. Assuming the database is hosted on the same computer as the one Moodle is being installed upon, accept localhost for the options when prompted.
  • Edit Moodle configuration options (if needed). (Use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu.):
sudo kate /etc/moodle/config.php
  • Edit Moodle apache2 configuration file (if needed). (Use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu.):
sudo kate /etc/moodle/apache.conf
  • Finish installation through the browser. (I recommend the "unattended" installation.)
http://localhost/moodle/admin

For more information, see these detailed tips. Moodle can also be integrated with other CMS systems, as well.

Claroline

Claroline is a free open source platform for hosting e-learning courses and online student collaboration. A LAMP server installation is required. Installation is from source files available at the website, with instructions found here.

Dokeos

Dokeos has a free learning platform, but also a medically-oriented proprietary platform that includes modules for case presentations and imaging. It is widely used in Europe.

Software Development

Kompozer Web Development Editor

Kompozer is a Gecko-based web authoring system that combines web page editing with web file management in a WYSIWYG manner. It supports XML, CSS, and JavaScript in an XUL architecture.

sudo apt-get install kompozer

Quanta Plus (Web IDE)

Quanta Plus is an integrated development environment integrated with the KDE desktop. It allows webpage development, database design, and XML design and scripting, for example, using multiple development tools. The latest stable version is 3.5, however, and integrates with the KDE 3.5 environment (Ubuntu Hardy Heron). You should therefore use Ubuntu Hardy Heron with this product. (There is also a commercial version (Quanta Gold), also oriented towards KDE 3).

sudo apt-get install quanta kompare kxsldbg cervisia

Netbeans IDE

Netbeans is a free open-source integrated development environment used to create applications using Ajax, Ruby, pHp, Groovy, Java, Javascript, C++, and other scripting tools.

sudo apt-get install netbeans

BlueFish Web Development Editor

BlueFish is a GTK-based (Gnome-oriented) editor to write websites, scripts and programming code. It supports perl, Python, pHp, CSS, XML, Java, Javascript, C, SQL, and other formats.

sudo apt-get install bluefish

Gobby (Multi-user development)

Gobby is a free, multi-platform open source collaborative editor supporting multiple documents in one session and a multi-user chat. Install:

sudo apt-get install gobby

Eclipse IDE

Eclipse is a free open-source cross-platform integrated development environment with plugin support for a large set of programming languages, e.g. Java, C/C++, Python, PHP.

sudo apt-get install eclipse

Version control software

Copies of software being developed at many different locations require a method to ensure that the multiple distributed copies remain synchronized. This can be done using a central repository or using a distributed synchronization technique. For further information, see the official Ubuntu documentation. Several version control platforms exist:

Git

  • Git allows distributed synchronization and is currently one of the most widely used systems. Also see the Ubuntu community documentation. The git client can be installed:
sudo apt-get install git
and the gitosis server software:
sudo apt-get install gitosis

SparkleShare (Git frontend)

SparkleShare is a Git repository server/client frontend. Installation is by adding a PPA repositoryand then installing:

sudo add-apt-repository ppa:warp10/sparkleshare 
sudo apt-get update
sudo apt-get install sparkleshare

Personal repositories

(K)Ubuntu uses Debian (.deb) packages. Individuals or organizations can create repositories for personal or specialized use. See the Debian wiki introduction. Also see this Ubuntu community advice and this.

mini-dinstall

Using mini-dinstall with dput, a simple repository can be created. This can then be copied to an online server for public or private access. See this tutorial and this.

Debarchiver

DebArchiver is a command-line utility that allows the creation of a folder-based repository. Instructions are from man debarchiver. Install:

sudo apt-get install debarchiver

FTP (online file transfer)

Also see these FTP tips.

WebDAV (online folders)

Maps and GPS

In addition to several online mapping services (such as Google Maps, MapQuest, and the open source OpenStreetMap), self-contained map packages can be installed on your computer (to be used with or without Internet access).

Google Earth

Google Earth gives you an annotated eagle's eye view of our planet. This is a free proprietary package (you must accept the license to use this package).

sudo apt-get install googleearth-package
make-googleearth-package --force
Doubleclick on the resulting .deb file.
-- or --

To install the latest Linux binary, download and save the GoogleEarthLinux.bin (currently version 5 ) package from Google Earth downloads. (You may alternatively download the previous version (4.3), named googleearth-linux-plus-4.3.7284.3916.bin or something similar.)

wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin

Then install:

chmod +x GoogleEarthLinux.bin
./GoogleEarthLinux.bin

Run:

K menu -> Internet -> Google Earth 3D planet viewer

You should turn off the Google Earth -> View -> Atmosphere setting, or you might see clouds everywhere and the ground won't show up.

Troubleshooting

  • If Google Earth opens, shows the splash screen, and then crashes, you’re probably experiencing a common issue. Running ~/google-earth/googleearth in a terminal will show this error:

./googleearth-bin: relocation error: /usr/lib/i686/cmov/libssl.so.0.9.8: symbol BIO_test_flags, version OPENSSL_0.9.8 not defined in file libcrypto.so.0.9.8 with link time reference

To fix this, browse to the folder you installed Google Earth into. (If you installed manually, this will be google-earth in your home folder.) Find the file libcrypto.so.0.9.8 and rename it to something else, like libcrypto.so.0.9.8.bak. Google Earth should now start correctly.

cd ~/google-earth
sudo mv libcrypto.so.0.9.8 libcrypto.so.0.9.8.bak
sudo ln -s /usr/lib/libcrypto.so.0.9.8 ~/google-earth/libcrypto.so.0.9.8
(Note: You can also specify /home/user/google-earth instead of ~/google-earth ).
  • On my display, I had to disable desktop effects (K menu -> System -> System Settings -> Desktop -> Desktop Effects) to get the display to work.

For other issues, see the Ubuntu help pages on Google Earth. Be careful of some of the suggestions there.

For example, if you turned on OpenGL desktop effects (using K Menu -> System Settings -> Desktop -> Desktop Effects -> General -> Advanced Options) and your display goes blank and you can't restore it, you will have to edit the settings file manually from the command-line to reset your mistake.

nano ~/.kde/share/config/kwinrc

In the section title [Compositing], under the line Backend=OpenGL (or whichever backend you had selected) change the line below it to read:

Enabled=false

The will reset your display and you can then reboot successfully into your default display (to try different settings from the menu again, if you wish).

Uninstall Google Earth

To uninstall run the uninstall shell script located in the /home/user/google-earth folder (or whichever folder you installed google-earth into).

GPS

Tux Mobil has a list of Linux applications for use with GPS devices, and compatible hardware. Two GPS packages are available from the Ubuntu/Kubuntu respositories:

  • Viking is a free open source package to view GPS data in maps, and to plot co-ordinates. This has been reviewed as the best Linux GPS mapping program.
sudo apt-get install viking
  • GPS Drive is a free navigation software package that displays your position on a zoomable map using your GPS device. It is GTK-based but can be used in Kubuntu. It uses the gpsd daemon that interfaces with a variety of GPS hardware. A .deb package of the current version is also available from the website. Install:
 sudo apt-get install gpsdrive
  • tangoGPS is a beautiful, lightweight GPS mapping program that uses map data from the Openstreetmap project. Is is a GPL-licensed open source project. A .deb package can be found here.

Celestial (Star) Maps

Celestia

Celestia is a free planetarium and space simulator for the desktop. Install:

sudo apt-get install celestia

Stellarium

Stellarium is an astounding planetarium for the desktop. Install:

sudo apt-get install stellarium

Science, Technology, and Engineering Applications

What .. you thought (K)Ubuntu was just for play? Also see Ubuntu Science.

Health applications

OpenEMR (Electronic Health Record)

OpenEMR is a mature, robust, outpatient-setting electronic medical record system that is certified in the US.

  • Make sure the LAMP (Linux, Apache, MySQL, PHP5) stack is installed first:
sudo tasksel install lamp-server

VistA (Enterprise Electronic Health Record)

OpenVistA and WorldVistA are two varieties of the largest and most robust CCHIT-approved electronic health record platform in the public domain. They are GPL licensed, are based on the US Veterans Administration health record system, and can be installed as an integrated database, server, and client system. See the detailed download and installation instructions for OpenVistA and WorldVistA, or visit Vistapedia for other instructions. Also see the Ultimate Server with OpenVistA EHR.

CAD

  • QCAD is a commercial CAD alternative to AutoCAD with a community open source edition. Install:
sudo apt-get install qcad
  • VariCAD is a commercial 3D CAD package for multiple platforms (including Linux). There is no open source or community version.

Mathematical solutions

Scilab, Octave, and Freemat are three open source solutions for solving complex numerical mathematical problems. Symbolic mathematical problems can be solved with Maxima and Mathomatic. All of these programs are included in the Ubuntu Universe repositories.

Octave

Gnu Octave is a free, open source (GPL licensed) platform for solving linear and non-linear equations, similar to (and mostly compatible with) Matlab. It interfaces well with Gnuplot. For troubleshooting tips, see this thread. Install:

sudo apt-get install octave3.0

Also recommended:

sudo apt-get install libatlas3gf-base gnuplot qtoctave

Note: QTOctave is a GUI for Gnuplot or Easyplot 1.1, and and the ATLAS library is an algebra-software-optimization set of utilities.

EasyPlot 1.1 is an alternative to GnuPlot, with a version that can be used with QTOctave. It must be installed from source.

An older GUI for Octave/Gnuplot is qgfe (available as the package qgfe).

Freemat

Freemat is a free, open source (GPL licensed) platform for solving linear and non-linear equations, similar to (and mostly compatible with) Matlab. Install from Add/Remove Programs (Edutainment) or

sudo apt-get install freemat

Maxima

Maxima is a free, open source (GPL licensed) computer algebra system (CAS) for doing symbolic mathematics. It can solve equations with many variables, simplify expressions, do calculus, and many other advanced operations. To install:

sudo apt-get install wxmaxima

To run, enter:

maxima

or select wxMaxima from the Applications/Science menu. wxMaxima is the standard Maxima GUI.

Mathomatic

Mathomatic is a free, open source (LGPL licensed) command-line computer algebra system for doing calculations and symbolic mathematics. It can automatically solve and simplify algebraic equations, do some calculus, and other simple but useful operations. To install:

sudo apt-get install mathomatic mathomatic-primes

To run, enter:

mathomatic

or select it from the Applications/Science menu.

Amateur Radio applications

Fldigi is a free, open-source (GPL) application for digital-mode amateur radio communications using a sound card. Enable "Community Maintained Software (universe)" in Software Sources; then install either from Add/Remove Programs under (Amateur Radio) or by typing

sudo apt-get install fldigi

Amateur Electronics

Arduino

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, and hobbyists interested in creating interactive objects or environments. See this tutorial.

LaTeX

LaTeX is a LaTeX is a free high-quality typesetting system for the production of technical and scientific documentation.

LyX

LyX is a WYSIWYG frontend and GUI interface useful in creating documents formatted for LaTeX. Install:

sudo apt-get install lyx

LaTeX Reference Managers

  • The standard LaTeX bibliography (BibTeX) tool can be manipulated with one of several tools:
  • nbibtex. Install:
sudo apt-get install nbibtex
  • jabref. Install:
sudo apt-get install jabref
  • biblatex. Install:
sudo apt-get install biblatex
  • kbibtex (for KDE). Install:
sudo apt-get install kbibtex
  • Zotero is a Firefox plugin that allows culling references (and reference content) from online references.

Miscellaneous software (not endorsed by this guide)

JBidwatcher

JBidwatcher is a Java-based application allowing you to monitor auctions, submit bids, snipe (bid at the last moment), and otherwise track your auction-site experience. See the website for more details.

Utilities

Utilities facilitate everyday tasks, such as keeping the clock up to date, archiving utilities, and more.

Archiving Utilities

ZIP

The command-line terminal utility ZIP creates files that are compatible with the time-honored PKZIP and WinZip. It is included in (K)Ubuntu by default. Extracting zip files can be done with the unzip utility. using the -P option allows using a password for the files:

zip -r -P mypassword desination.zip *

Note: The -r option indicates to include all subdirectories recursively.

FileRoller (Archiving GUI)

FileRoller is a GUI for many types of archival utilities.

X-archiver (Archiving GUI)

Xarchiver is a GTK-based GUI front-end for many archiving utilities. Install:

sudo apt-get install xarchiver

BChunk

BChunk is a command-line utility that allows you to convert .cue and .bin files into an .iso file (so that they can be opened and manipulated in Ubuntu). Warning: If the bin/cue image has audio tracks, they will be lost.

Get BChunk

sudo apt-get install bchunk

To convert .cue and .bin files, navigate to the folder and run this command (replacing filenames with your own):

bchunk inputfilename.bin inputfilename.cue outputfilename.iso

After the file is converted into ISO you can mount it using:

sudo mount -o loop outputfilename.iso /media/output

Navigate to /media/output and you should see all the content there. You can then copy it anywhere.

To unmount:

sudo umount /media/output

HJSplit Files Joiner/Splitter

HJSplit for Linux (Java version).

  • Make sure you have Java Runtime Environment installed:
sudo apt-get install sun-java6-jre
  • Download the HJSplit JAR file:
wget http://www.freebyte.com/download/hjsplit/hjsplit_g.jar
  • Create the directory for HJSplit:
sudo mkdir /opt/hjsplit
  • Move the file to an appropriate directory:
sudo mv hjsplit_g.jar /opt/hjsplit/ 
  • Run:
cd /opt/hjsplit/ && java -jar hjsplit_g.jar 
Note: You could also make a terminal shortcut (menu item) in K Menu Editor.

Rar

Rar archives files into the proprietary .rar format.

sudo apt-get install rar

This application is a 40-day trial.

Unrar

Unrar extracts files archived with the proprietary .rar format. A free version can be installed:

sudo apt-get install unrar-free

or the proprietary version (also free for noncommercial use) can be installed with the ubuntu-restricted-extras package or with:

sudo apt-get install unrar

7-Zip

The open-source 7-Zip archive format was originally designed for Windows (and DOS) but is also available for Ubuntu. The GNU/Linux version of 7-Zip does not come with a GUI, but Ark can hook into 7-Zip to handle 7z archives. Install:

sudo apt-get install p7zip-full

To allow the 7-Zip extension for Ark to extract .rar files, also install:

sudo apt-get install p7zip-rar

Hard Drive Utilities

KDiskFree (Hard drive properties monitor)

KDiskFree is a KDE utility for monitoring free disk space, etc.

sudo apt-get install kdf

Clock Utilties

Screensavers

A screensaver is useful as a security precaution as well as a power and screen element saver. Using even a simple "Blank Screen" screensaver with a password can slow a potentially malicious passerby from gaining access to your keyboard and computer while you are away from your desk.

Menu -> System -> Preferences -> Screen Saver
  • Set a security password:
Screen Saver -> Lock screen when screensaver is active (ticked)

Partition Managers

Also see these tips for partitioning scheme suggestions, other partitioning tools and methods, and usage of multiple partitions for multiple OSs.

GParted Partition Manager

Gparted is a GTK (Gnome)-based partition manager that can also be used with KDE.

  • This utility works best when run from a LiveCD. Recent versions of the Ubuntu LiveCD have a copy of GParted on them. Start the Ubuntu LiveCD in demo mode (not in install mode) and then start GParted:
Menu -> System -> Administration -> GParted
  • You can also install the package into your OS (once it is installed on your hard drive):
sudo apt-get install gparted

System Backup and Recovery

Rsync

Rsync is the directory backup and transfer tool for Linux. It is installed by default in Ubuntu. It can provide any type of backup, and options are extensive. Several GUI frontends for Rsync are listed here.

GRsync

GRsync is a GTK-based GUI front-end for Rsync. Install:

sudo apt-get install grsync

Bacula

Bacula is the most widely-used GTK-based open source (GPL-licensed) network backup utility that is used in both server and desktop installations. A catalogue of backups can be maintained using MySQL, PostgreSQL, or SQLite. For more info see the Ubuntu documentation. Both text-based and GUI frontends are available. Install the MySQL version:

sudo apt-get install bacula

SBackup

SBackup is a simple backup and restore utility for the GTK-desktop. Install:

sudo apt-get install sbackup

Keep (Backup and Recovery)

Keep is a QT/KDE based backup utility used in previous versions of Ubuntu. It is no longer maintained and is not included in Ubuntu by default. Install:

sudo apt-get install keep

Run:

  • Menu -> Applications -> System Tools -> Keep (Backup System)
  • Backup:
Click "Add a Directory to Backup"
Select directories you wish to backup
Select a location to place the backup
Set how often you wish the backups to take place, and how long to keep them
Click "Backup Now"
Select the directory groups you wish to backup.
  • Recover:
Click "Restore a Backup"
Select the directory groups you wish to restore.

Partimage (Partition backup)

Partimage is a free open-source utility to back up an entire partition into an .iso image. It can be used across a network, as well. Install and run:

sudo apt-get install partimage
sudo partimage

Partimage cannot be used from within the partition you wish to backup. You will either have to run it from a different partition or from a LiveCD that contains it. (A serious limitation of Partimage is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

cp

An entire partition's filesystem can easily be copied to another partition using the cp -a command. (However, this cannot be done for the partition of a filesystem that is running. Use the (K)Ubuntu LiveCD to copy partitions when necessary.) Obviously the destination partition should be as large or larger than the source partition, and while not necessary, probably is best if both partitions are of the same filesystem type (e.g. ext4). Use GParted to create or manipulate the destination partition, if necessary. To copy the entire filesystem, for example, from the ext4 partition /dev/sda6 into the ext4 partition at /dev/sda7, mount both partitions:

sudo mkdir /media/partsda6
sudo mkdir /media/partsda7
sudo mount /dev/sda6 -t ext4 /media/partsda6
sudo mount /dev/sda7 -t ext4 /media/partsda7

Then merely copy the contents from one partition to the other:

sudo cp -a /media/partsda6/* /media/partsda7
  • Of course, once the partition's filesystem is copied, a bootmanager (Grub2 or Grub Legacy) will have to be updated/reconfigured to recognize the new partition's OS in order to enable it to boot. Also, the /etc/fstab file of the new partition's filesystem may need to be edited (in regards to the UUIDs of the various partitions), to prevent conflicts. To determine the UUIDs of all current partitions on a hard drive:
sudo blkid

Edit fstab so that the UUIDs are correctly reflected there.

  • To confirm that the file copy has completed, the Linux command du (also see these tips) can be used to calculate the disk usage for both the source and destination folders in order to compare the values (to ensure that they are the same). For example, the values should be the same for both partitions after copying has completed:
sudo du /media/partsda6
sudo du /media/partsda7

dd

dd is a *nix command that enables the copying of files or an entire disk using a single command. Parameters must be precisely specified to avoid risk of accidentally erasing data. See these brief instructions or these instructions for detailed options. You cannot copy a hard drive that contains the operating system you are currently running. Instead, boot into a LiveCD and run the dd command that way. An example command to copy Hard drive X to Hard drive Y is:

dd if=/dev/hdx of=/dev/hdy
  • ddrescue is a variation of the dd command that allows working with potentially corrupted datasets, partitions, or hard drives.

FSArchiver (Filesystem Archiver)

FSArchiver is a utility to backup the filesystem by files (instead of by partition blocks). A filesystem backed up in this way can be moved to a different sized partition or another disk filesystem altogether (e.g. from ext3 to ext4). Backups can be split and stored on (and restored from) spanned media (e.g. multiple DVDs/CDs). It is included in the System Rescue CD. Install:

sudo apt-get install fsarchiver

System Rescue and Cloning Utilities

System Rescue CD

SystemRescueCD is a LiveCD that includes important utilities such as GParted, Partimage, ddrescue, Rsync, and FSArchiver. Several of these utilities cannot be used from within a running partition, so using them from a LiveCD is often necessary. Download and burn the LiveCD from the website.

Clonezilla

Clonezilla allows the backup or duplication of a partition for a single machine or for multiple machines over a network. (It is similar to Norton Ghost.) It includes Partimage, partclone, and other utilities. It is available as a LiveCD which can then be burned. (A serious limitation of Clonezilla is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

Disk Imaging software

  • G4U is a utility to image a disk bit by bit.
  • G4L is a utility to image a disk bit by bit. It includes a GUI interface.

Ubuntu Customization Kit

sudo apt-get install uck

Remastering software

Debian and (K)Ubuntu Linux operating systems can be "remastered" and customized (using one of a number of utilities) for re-distribution. (See this Wikipedia list.) This enables an organization to pre-load desired applications and customizations for distribution among its members, while preserving the intrinsic architecture and function of (K)Ubuntu. The customized (K)Ubuntu OS can then be distributed on a CD or on a USB flashdrive. Users are then free to further customize the OS, or even to revert back to the original default (K)Ubuntu settings. Also see the Ubuntu wiki.

  • oem-config-gtk
sudo apt-get install oem-config-gtk

Run (K)Ubuntu LiveCD from a USB pendrive

The (K)Ubuntu LiveCD can be installed on and run from a USB pendrive. Settings can be "persistently" saved (but the LiveCD kernel modules can not be upgraded). Programs can be installed and run, however, and files saved to the USB drive. (The installed programs will remain installed). A (K)Ubuntu Live CD is needed to do the installation. For additional info, see the Ubuntu Community documentation or the Pendrivelinux instructions.

The USB "LiveCD" can be used to install (K)Ubuntu on computers (including netbooks) that do not have CD-ROM/DVD drives.

USB pendrives to be used to run Ubuntu should have a minimum of 2 Gb (preferably 4 Gb). If you wish to install a fast, fully functional Linux system on a pendrive that has less memory than that, use PuppyLinux or Lubuntu.

USB Creator

You can make a "LiveCD" on a USB pendrive using USB Creator and either a LiveCD or an .iso version of the LiveCD stored on your hard drive. USB Creator is installed by default in Ubuntu. If not, install:

sudo apt-get install usb-creator-gtk
  • Run:
Menu -> System -> Startup Disk Creator

Create a boot CD to allow booting from the USB drive

Many computers do not allow booting from a USB drive (but they do allow booting from the CD-ROM). You can create a CD-ROM using these Pendrivelinux instructions and set your BIOS to boot from this CD-ROM. When you boot from this CD-ROM, it will use the bootup files on the Ubuntu USB drive you previously created (in the step above).

User Administration

Users and Groups

  • Note: The Unity user interface does not currently have a GUI method to modify user and group settings. For an introduction to managing users and groups from the CLI (command-line interface) see the Ubuntu Server Guide and this brief tutorial.

Manage Users and Groups with the Gnome2 GUI

  • Gnome2 (the user interface for older versions of Ubuntu) included a GUI for managing users and groups. That Users and Group Management Tool from Gnome2 can be installed as part of Gnome System Tools:
sudo apt-get install gnome-system-tools

You can then launch it from Unity Dash, by pressing ALT+F2, or by creating a menu item with the command:

users-admin 
  • Change user and group settings
Menu -> System -> Administration -> Users and Groups
  • Add New Users
Menu -> System -> Administration -> Users and Groups -> Add
  • Remove Users
Menu -> System -> Administration -> Users and Groups -> user -> Delete
  • Modify Users
Menu -> System -> Administration -> Users and Groups -> user -> Advanced Settings
or
Menu -> System -> Administration -> Users and Groups -> user -> Manage Groups

It is quite often necessary to have extra privileges to do certain tasks. These privileges are assigned to your user by belonging to certain groups. The tasks are allowed to be performed by any user belonging to the group associated with that task.

Example: a "sudoer" is a user who can perform certain administrative tasks, such as updating the system. To become a "sudoer" a user must belong to the "sudo" group.
Menu -> System -> Administration -> Users and Groups -> user -> Manage Groups --> sudo -> Properties -> Group Members -> user (ticked)

To become an administrator, you must belong to the adm, admin, and sudo groups. To be a virtualbox user, you must belong to the virtualbox group. To change printer settings you must belong to lpadmin. To use the cdrom, you must belong to cdrom. To use hot-pluggable devices, you must belong to plugdev. To share Samba folders (on a Windows-based network), you must belong to sambashare. To access NTFS files using the virtual filesystem fuse, you must belong to the fuse group. To use many games, you must belong to the games group. The list is long, and not always obvious.

Unfortunately, while this is the feature that gives Linux such a high-level of security, it can also take diligence to remember to add your user to certain groups. It is not uncommon for programs and functions on your system not to work merely because you don't have privileges to do so because you forgot to add your user to the appropriate group(s).

Of most importance, you must already be an administrator in order to change membership in groups. Therefore, if you create a new user and intend to give that user administrative privileges (by assigning the user to the administrative groups), you must do so from your original administrator account (the one you set up at installation) or from another administrative user account.

Timekpr (Parental controls)

Timekpr is a program to track and control the computer usage of user accounts. (This is different from KTimeTracker, which merely records your usage but does not restrict it.) It is available from a Launchpad PPA.

  • If updating, remove any prior versions:
sudo dpkg --purge timekpr
deb deb http://ppa.launchpad.net/timekpr-maintainers/ppa/ubuntu oneiric main
deb-src deb http://ppa.launchpad.net/timekpr-maintainers/ppa/ubuntu oneiric main
  • Install:
sudo apt-get install timekpr
When prompted which default display manager to use, select "kdm"
  • Start:
K menu -> System -> Timekpr Control Panel

Web content filtering

DansGuardian provides web filtering capability, similar to NetNanny. It is useful for limiting objectionable content in publicly accessible workstations, or for filtering objectionable content for younger users. It integrates with ClamAV, and uses several criteria for filtering websites (which is difficult to modify). It is used with Tinyproxy (best for individual users) or the Squid proxy (best for a network server). Install:

sudo apt-get install dansguardian tinyproxy
or
sudo apt-get install dansguardian squid

See these installation instructions for setup details. In brief,

  • Edit the dansguardian configuration file:
sudo nano /etc/dansguardian/dansguardian.conf
comment out the UNCONFIGURED line:
#UNCONFIGURED
If using tinyproxy instead of Squid, change the proxyport to 8888:
proxyport 8888
  • Reinstall dansguardian:
sudo apt-get install --reinstall dansguardian
  • Set your browser to use the localhost:8080 proxy. For example, in Firefox:
  • Firefox -> Edit -> Preferences -> Advanced -> Network -> Settings
  • Manual proxy configuration -> HTTP proxy: localhost -> Port: 8080

System Administration

Automating Tasks

  • Cron is a system daemon that runs tasks in the background according to instructions found in a crontab file. To edit the crontab file for the current user:
crontab -e

Tasks that normally require administrative (sudo) privileges should be added to the root user's crontab:

sudo crontab -e

Add commands using the format specified here (or see the Ubuntu Community Help). The crontab command format can also be found using:

man crontab
  • Scheduled/automated tasks (cron events) can also be edited using the GNOME schedule GUI interface.
Menu -> System -> Administration -> Task Scheduler
  • If the GNOME Schedule task scheduler is not installed, install it:
sudo apt-get install gnome-schedule

Boot Menu

Login Menu settings

You can change the Login menu settings from the GUI interface:

Menu -> System -> Administration -> Login Manager

You can choose an integrated theme or select individual components of the login screen/process.

Automating bootup options

StartupManager is a GUI to manage settings for Grub (Grub Legacy), Grub 2, Usplash, and Splashy.

GRUB boot manager settings

Grub2

Oneiric comes with Grub2, a difficult boot manager to customize. (Grub2 is also known as grub-pc.) See the evolving instructions at the Ubuntu wiki or Ubuntu forums. In brief, some settings can be edited:

sudo nano /etc/default/grub
sudo grub-mkconfig --output=/boot/grub/grub.cfg

Alternatively, use the command:

sudo update-grub
Grub2 background image, colors, fonts
  • See this Ubuntu Forums thread.
  • Any background image can be used for Grub2 by placing the image in the /boot/grub folder and then reconfiguring Grub2:
sudo update-grub

The image ought to be the same size as the Grub2 startup resolution specified in /etc/default/grub (e.g. 1024x768).

  • A selection of splashimages can be installed into the /usr/share/images/grub folder:
sudo apt-get install grub2-splashimages
  • One of the images can be linked to the /boot/grub folder and used as the splash image. For example:
sudo ln -s /usr/share/images/grub/Plasma-lamp.tga /boot/grub
sudo update-grub
Protecting Grub2 from cracking
  • To add password protection, in the /etc/grub.d/40_custom configuration file, add the lines:
set superusers="user1"
#password_pbkdf2 user1 grub.pbkdf2.sha512.10000.biglongstring
password user1 insecurecleartextpassword

and change your password to something other than insecurecleartextpassword, or use the pbkdf2-encrypted method described here. You can then password-lock menu items as well. For detailed info see this blog.

GRUB Legacy

The older version of GRUB ("Grub Legacy") is available, for use with a boot partition, for example. Install:

sudo apt-get install grub
  • If you have multiple operating systems (OS) on your computer, you may be using the GRUB Legacy boot manager (in a boot partition, for example). You can edit the options for GRUB Legacy in the menu.lst configuration file. (See this detailed info.)
sudo nano /boot/grub/menu.lst
(gedit can also be used instead of nano as the text editor.)
Chainloading Grub2 from Grub Legacy
  • Grub2 is erratic. I no longer chainload it. Instead, it is possible to bypass Grub2 entirely and load an OS directly using Grub Legacy (stored in a boot partition, for example) using an entry in menu.lst of the format:
title Kubuntu Oneiric OS (chainloader)
rootnoverify (hd0,6)
kernel /vmlinuz root=/dev/sda7 ro
initrd /initrd.img
  • My old method for chainloading Grub2 (installed in this example in the /dev/sda7 partition) from Grub Legacy used an entry in the Grub Legacy configuration file (/boot/grub/menu.lst, stored in the standalone boot partition with the Grub Legacy files) with this format:
title (K)Ubuntu Oneiric OS (chainloader)
rootnoverify (hd0,6)
kernel /boot/grub/core.img
Protecting Grub Legacy from cracking
  • To add password protection, in the /boot/grub/menu.lst configuration file, uncomment (remove the hashmark) from the line:
#password topsecret

and change your password to something other than topsecret, or use the md5-encrypted method described here. You can then password-lock menu items by adding the descriptor lock below the title of any item menu.

Default Applications

In previous version of ubuntu, you could choose which program to use as your default program for a specific task.

Menu -> System -> Administration -> Default Applications

or by right-clicking on any file and choosing the "Open with Other Application..." option.

The Default Applications menu has now been removed from Ubuntu, however. For a GUI that will allow this and multiple similar Ubuntu system tweaks, install Ubuntu Tweak:

wget http://launchpad.net/ubuntu-tweak/0.5.x/0.5.8/+download/ubuntu-tweak_0.5.8-1_all.deb
sudo dpkg -i ubuntu-tweak_0.5.8-1_all.deb

Kill a process

Sometimes a program (or "process") just freezes. To "kill" (or end) the program/process:

Menu -> System -> Administration -> System Monitor -> highlight the errant process -> Kill process

From the command line:

sudo killall process
where process is the name of the frozen program, such as firefox.

Enabling NUM LOCK On Startup

Menu -> System -> Administration -> Keyboard & Mouse -> Keyboard ->"turn on Numlock on Startup"

Working with Menus

Create an encrypted folder

You can create a folder whose contents are encrypted. See these instructions.

Create a symlink from a file to another location

A symbolic link (also known as a symlink) is a method in Linux of referring to a file (or directory) in one location from another location. Usage:

ln -s /path/to/source /path/to/destination

If /path/to/destination requires superuser rights, then use:

sudo ln -s /path/to/source /path/to/destination

This is similar to, but more powerful than, creating Shortcuts, with which former Windows users may be familiar.

Assign a root password

To be able to log in as root directly, you must assign a root password. This can be done with:

sudo passwd root

Afterwards, you can use

su

to get a root prompt. You would then use the root password.

Get a root prompt without using a root password

If you have not set a root password (or don't know it), you can obtain root user privileges anyway. From the command-line Terminal:

sudo -s
or
sudo su
or
sudo bash

You will use your own user password instead of a root password.

You could also get a prompt to become any other user on the computer by typing:

sudo su <username>

Use the File Manager as root

sudo nautilus
or
gksudo nautilus

Manually Mount and Unmount a device

To manually mount a device:

mount /dev/hda

replace /dev/hda with the location of the device.

To manually unmount a device:

umount /dev/hda

replace /dev/hda with the location of the device.

Windows Compatibility

Mounting NTFS Partitions (with read/write privileges)

Find out the name of your ntfs partition:

sudo fdisk -l

Method 1: In this example, the NTFS drive is listed by fdisk as /dev/sda2, but yours may differ.

Make a mount point for the drive:

sudo mkdir /media/WindowsNTFS

Edit fstab:

sudo nano /etc/fstab

Comment out the automatically added lines by Ubuntu installation:

#/dev/sda2  auto nouser,atime,noauto,rw,nodev,noexec,nosuid 0 0
#/dev/sda2 /mnt auto user,atime,noauto,rw,nodev,noexec,nosuid 0 0

and instead add the line:

/dev/sda2 /media/WindowsNTFS ntfs-3g quiet,defaults,rw 0 0

Note: There are many ways to mount the drive, depending on your needs. The fstab file controls this process. See How to edit and understand fstab and Intro to using fstab.

In this example, I indicated that the file system was an ntfs-3g filesystem, so did not use the auto option (which detects the filesystem automatically). I used rw to specify read/write privileges for all users, but umask=0 and umask=000 are accepted by some kernels.


Method 2: Edit fstab:

sudo nano /etc/fstab

When Ubuntu installation finishes, it mounts all ntfs partitions automatically with ntfsprogs, adding a line similar to the following to fstab:

UUID=8466268666267956 /media/sda1     ntfs    defaults,gid=46 0       1

Change this line to:

UUID=8466268666267956 /media/sda1     ntfs-3g    defaults,nls=utf8,locale=zh_CN.UTF-8,rw,gid=46 0       1

In this example, I have a Chinese-language Windows installation on my first partition, so I set the locale parameter (locale=zh_CN.UTF-8) so that my Chinese documents can display correctly. Setting rw (same as umask=0 or umask=000) lets me read/write the partition without sudo. gid=46 specifies that the drive will belong to the group of hot-pluggable devices (plugdev) and is not necessary unless your ntfs drive is a hot-pluggable one (such as an external USB drive). nls=utf8 is the default and is optional for most ntfs users, but there are other options for Chinese (and other specialized character-set users).

Mounting FAT32 Partitions

Follow the above instructions, but use vfat instead of ntfs-3g.

In other words, if you have made a mount point directory /mnt/WindowsFAT32 and your FAT32 drive is /dev/sda3, then edit the /etc/fstab file to include the line:

/dev/sda3 /mnt/WindowsFAT32 vfat quiet,defaults,rw 0 0

Synchronize clock to network time server

The Network Time Protocol (NTP) allows time synchronization of your computer to time servers on the Internet.To enable it:

  • Applications menu -> System Settings -> Date & Time
  • Check the "Set date and time automatically" option
  • Choose an ntp time server near you.

Hardware

CPU and motherboard

The Linux kernel in versions of (K)Ubuntu starting with Karmic Koala implemented mandatory CPU temperature and fan speed sensor monitoring (which was optional in previous kernels). The output from the sensors is used to effect CPU scaling (throttling) in the event of "out of range" temperature values. However, not all motherboards/CPUs have sensor drivers available, and due to a bug in the feedback routine, missing sensors drivers incorrectly report as an "out of range" error in the kernel. Originally this threw multiple errors which were logged (using rsyslogd) to both the /var/log/kern.log and the /var/log/syslog files, filling them to multiple Gb size within a few hours. This had the effect of slowing, then freezing, the machine. Currently, the machine will simply not boot.

If your machine is affected by this problem, you may be restricted to versions of (K)Ubuntu that are Jaunty or earlier (or you must undertake extensive workarounds).

Disable CPU Frequency scaling

(Note: These instructions may not work with newer Linux kernels.) My motherboard does not have drivers for my CPU fan sensor. Therefore, the Linux kernel cannot monitor the temperature and fan speeds properly and throttles the CPU (aka frequency scaling) inappropriately. This has the effect of slowing or freezing my computer. To turn off this behavior, I used the Debian RCConf utility:

sudo apt-get install rcconf
sudo rcconf

and unchecked the ONDEMAND item. (I also unchecked the fan control item). I then rebooted. For more info, see this.

libsensors

libsensors (libsensors3 and/or libsensors4) is a module that allows an interface (such as lm-sensors) to monitor your motherboard/CPU temp and fan speeds. You can adjust settings:

sudo kate /etc/sensors.conf
sensors -s

libsensors and lm-sensors are not used by the Linux kernel (which uses other routines).

Some hardware CPU sensors are not recognized by the Linux kernel, causing system slowdown or freezing. Here is some info about hardware/sensors problems.

Sensors-applet (Motherboard monitoring)

Sensors-applet (or xsensors) is the Gnome (Ubuntu) frontend for lm-sensors. These sensors monitor the temperature and fan-speed sensors of your motherboard.

sudo apt-get install sensors-applet lm-sensors
sudo sensors-detect
sensors-applet
  • Make sure your sensors are installed.
sensors

For more info, see this thread.

Graphics Cards

Frequency Out of Range / Choose New Resolution

  • Edit the grub configuration file:
sudo gedit /etc/default/grub
  • Edit the lines:
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
by removing the comment hashmark and choosing an appropriate resolution so that the lines resemble:
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768
  • Re-build the grub configuration file:
sudo update-grub

Install Latest Nvidia/ATI drivers

Ubuntu uses a GUI frontend to Jockey for the installation of the proprietary nVidia drivers (and other proprietary drivers).

Menu -> System -> Hardware Drivers
  • Sometimes after a kernel upgrade a proprietary driver may stop working. In such a case, try installing the new linux-headers that match the newly upgraded kernel:
sudo apt-get install linux-headers-$(uname -r)
If dkms and build-essential have never been installed on your system, these can also be worthwhile:
sudo apt-get install dkms build-essential

Intel integrated graphics cards

  • With the default installation of Maverick, my computer with integrated Intel graphics blanked the screen at bootup and then froze. These steps work around this problem.
  • When booting up, choose recovery mode as root (or "root with networking"). This will give the command line (as root user).
  • Edit the Grub2 configuration file:
sudo nano /etc/default/grub
  • Change the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.modeset=0"
  • Then regenerate the Grub2 configuration file:
sudo grub-mkconfig --output=/boot/grub/grub.cfg
When I then rebooted, my graphics worked.
Intel graphics resolution problems
  • On a fresh installation of Karmic Koala I had no problems with my onboard Intel graphics card. However, on an update from Jaunty to Karmic, I could not get higher screen resolutions -- the same problem I had in Jaunty. A solution to achieve higher resolutions is to revert to the old Intel drivers (used in Intrepid), as detailed here.
Screen Keeps Flickering

If you have an Intel Corporation Mobile 915GM/GMS/910GML card, your screen may flicker every 5-10 seconds. To prevent this:

  • Menu -> System -> Administration -> Advanced -> Service Manager -> Uncheck "Detect RANDR (monitor) changes"

Reconfigure xserver-xorg

sudo dpkg-reconfigure xserver-xorg

xorg.conf

Before installing any driver for ATI or nvidia, please make backup xorg.conf before following this method.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

If you have edited this file but would like it to be automatically updated again, run the following command:

sudo dpkg-reconfigure -phigh xserver-xorg

If you want to try this xorg.conf after installing the driver, you must back up your xorg.conf as following. And then, edit /etc/X11/xorg.conf in text editor. Add or modify this xorg.conf sample.

xorg.conf for nvidia
 Section "Screen"
 Identifier "Default Screen"
 Device "Configured Video Device"
 Monitor "Configured Monitor"
 SubSection "Display"
 Depth 16
 Modes "1280x1024" "1024x768"
 Option "AddARGBGLXVisuals" "True"
 EndSubSection

 Option "AddARGBGLXVisuals" "True"
 Defaultdepth 24
 EndSection
 Section "Module"
 Load "glx"
 Load "GLcore"
 Load "v4l"
 EndSection
 Section "Device"
 Identifier "Configured Video Device"
 Boardname "vesa"
 Busid "PCI:1:0:0"
 Driver "nvidia"
 Screen 0
 EndSection
 
 Section "Device"
 Identifier "Device0"
 BoardName "Generic Geforce 5500"
 Driver "nvidia"
 Vendorname "NVIDIA Corporation"
 Option "DualHead" "1"
 Option "ShadowFB" "1"
 Option "FPScale" "1"
 Option "TwinView" "True"
 Option "TwinViewOrientation" "RightOf"
 Option "UseEdidFreqs" "True"
 Option "Metamodes" "1024x768,1024x768"
 Option "UseDisplayDevice" "DFP"
 EndSection
 
 Section "Device"
 Identifier "Videocard0"
 Driver "nv"
 VendorName "NVIDIA Corporation"
 BoardName "GeForce 7600 GT"
 EndSection
 
 Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "us"
 EndSection

 Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 EndSection
 Section "ServerLayout"
 Identifier "Default Layout"
 screen 0 "Default Screen" 0 0
 EndSection
 
 Section "Extensions"
 Option "Composite" "Enable"
 EndSection

Installation of ATI and nVidia Graphics drivers

nVidia Driver

The current proprietary nVidia drivers are automatically installed using:

Menu -> System -> Administration -> Hardware Drivers

Look for the current drivers to activate there.

  • Here are alternate manual instructions.
  • Please make a backup of xorg.conf before following this method.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
  • Install the nvidia-settings package:
 sudo apt-get install nvidia-settings
  • Download the nVidia driver:
wget -O NVIDIA-Linux-x86-pkg1.run http://www.nvidia.com/Download/index.aspx?lang=en-us
sudo sh NVIDIA-Linux-x86-pkg1.run

and choose yes to any verbose response. After you install the driver, reboot your computer.

ATI Driver

If you have problems with ATI drivers after upgrading, check this link for solutions to common problems with ATI.

Monitors / Displays

Turn off power saving

Even when on AC power, the power saver feature of Ubuntu sometimes changes the screen brightness to the battery setting on laptops. This was a problem with the ACPI power management module in the past, but should now be fixed. If not, change the settings:

To access the Guidance Power Manager module, click on the power icon on the desktop taskbar.
Change the brightness setting for "Battery powered" to maximum.

You can also turn off power management settings (invoked when the computer is idle):

Menu -> System -> Preferences -> Power Management -> Display -> Put display to sleep when inactive for: Never -> Close

Configure Dual Monitors with nVidia

  • Make sure that the nVidia driver has been installed and is functioning properly on your first screen. Also, make sure both monitors are connected.
  • Menu -> Administration -> NVIDIA X Server Settings
or from the command-line terminal (Terminal or Konsole) type:
sudo nvidia-settings
  • Select "X Server Display Configuration".
  • You should see 3 boxes (2 if your card doesn't have an S-Video out). From here you can configure all of your card's outputs.
  • Check the "(Disabled)" box.
  • Select "Configure...".
  • The most common choice is TwinView. Select it.
  • Setup the desired screen resolutions and positions of your two active displays.
  • The new display will likely have resolution set to "Auto" to match your first. Change this if you wish.
  • Leave the first screen's position as "Absolute" and set your second display's position relative to that.
  • "Clone" means the same output on both.
  • Once you are satisfied with your settings, hit Apply to test them.
  • Note: if your displays are side-by-side, the kicker may extend across both screens as well as any maximized applications. This will be corrected when the X server is restarted.
  • If everything else is ok, hit "Save to X Configuration File". Now hit Ctrl+Alt+Backspace to restart X. You now have 2 screens!
  • Troubleshooting: if the X server fails to reload you can recover your old X configuration. In a terminal:
sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf

Hard Drives and USB Storage

Optical Drives

Printers & Scanners

The new CUPS interface recognizes many printers. Specific printers not recognized can often be installed using instructions found at the Linux Foundation OpenPrinting database.

Add a Printer

Menu -> System -> Administration -> Printing -> Server -> New -> Printer

Most of the time, your printer (if connected and turned on) will be detected automatically.

My network printer with its own IP address at 192.168.0.124 was correctly installed at

socket://192.168.0.124:9100.

You can also choose printers on a Windows system via Samba and other types of networked printers, in addition to directly connected printers.

Use CUPS web interface

From any web browser, go to the URL:

http://localhost:631

Brother printers

Most Brother printers are auto-detected or can be installed directly from the CUPS interface. For additional drivers and instructions see the Brother help site. For information on a specific model, see the Linux OpenPrinting site.

HP Printers

For Hewlett Packard printers / scanners, install hplip and hplip-gui.

sudo apt-get install hplip hplip-gui
  • Add the printer:
Menu -> Applications > System Tools > HP Toolbox

This should set up printer / scanners for scanning as well.

  • For scanning, install Xsane:
sudo apt-get install sane xsane

Run:

Menu -> Applications -> Graphics > Xsane image scanning

A full library of Linux drivers for HP printers is here.

Sound

If you get no sound with a fresh install, check that the sound levels are not set to zero. Click on the sound (speaker) icon on the panel, and then mixer. You may need to expand the dialog window to show labels. Ensure levels aren't set to zero, especially PCM.

PulseAudio

Sound in (K)Ubuntu is routed by Phonon either directly to your sound card or through the PulseAudio sound system. To use PulseAudio, you must install it. This can be done by installing the PulseAudio control modules (which will install pulseaudio as a dependency):

  • Install PulseAudio with the control modules:
sudo apt-get install pavucontrol paprefs
  • Although I no longer use it, in older versions of (K)Ubuntu I also (optionally) installed a system tray widget:
sudo apt-get install padevchooser
padevchooser

Some experimentation with the settings in

Menu -> System -> System Settings -> Multimedia

may be necessary to make sound on your system work properly.

Try setting PulseAudio as the first sound system if you are having troubles getting sound (even if you are using ALSA). If that doesn't work, try making it the last choice.

Some programs require ALSA sound and try to send sound directly through ALSA drivers. Check your program's preferences section to see if ALSA is selected. You may have to switch to PulseAudio (or even OSSound) if you can't get sound.

HDMI with PulseAudio

I could only get my HDMI audio on my computer to work this way, and I can't quite figure out why it works.

  • I checked to make sure my Mobile Intel 4 Series HDMI audio driver was installed (it is part of the most recent kernels):
aplay -l
aplay -L

This told me the HDMI card was recognized and configured properly. The problem was that no matter what I did, I couldn't get the sound piped through the HDMI card using ALSA, Kmix or any other settings (I tried every permutation).

  • In PAVUControl I selected the HDMI card as the output device:
Menu -> Multimedia -> PulseAudio Volume Control -> Configuration -> Internal Audio -> Digital Stereo (HDMI) Output

Then everything played through the HDMI audio card (through the cable to my HDTV).

This worked whether I had PulseAudio selected as the default audio or not (in System settings -> Multimedia). Don't ask me why.

  • My HDMI port/output is only recognized if the HDMI cable is plugged in at bootup (it does not matter whether the HDTV power is on or not). If I plug in the HDMI cable after bootup, it isn't recognized.
  • After doing this, every program I use works: VLC, Audacious, or whatever. It does not seem to matter whether the application is using Default, ALSA, or PulseAudio for the audio output plugin. None of this makes sense to me, but it works. I'm happy to be able to play HDMI movies (through VLC) to my HDTV.
  • To change sound output back to my computer's internal speakers (ALSA), I returned the output setting:
Menu -> Multimedia -> PulseAudio Volume Control -> Configuration -> Internal Audio -> Analog Stereo Output
Recording with PulseAudio

To set the PulseAudio inputs that will be recorded by an application (such as Audacity or FFMPEG), the recording must be already started! Only then can the inputs (to be recorded) be selectable in PulseAudio.

  • For example, to record from a plug in microphone using Audacity, make sure the microphone is plugged in. Make sure in the Sound Mixer (icon) that the microphone is not muted and that the levels are set appropriately.
  • In PulseAudio Volume Control, select the device that will be the input.
Menu -> Multimedia -> PulseAudio Volume Control -> Input Devices -> Show: All Input Devices
-> Internal Analog Audio Stereo: Port: Analog microphone

Of course, you should use the device you wish to use here. You can also select the Monitor of Internal Analog Audio Stereo device, which will use as an input to the recording/capture application whatever happens to be playing through the sound card (except for hardware inputs).

  • Start Audacity (or other recording application). Make sure (in Audacity) that the Devices toolbar is visible:
Menu -> Multimedia -> Audacity -> View -> Toolbars -> Device Toolbar (ticked)

Assuming you are using ALSA, make sure ALSA is selected, and that pulse is selected for both the output and microphone input on the Device Toolbar. Start recording.

  • Start PulseAudio Volume Control. Under the Recording tab, you should see Audacity listed as "ALSA plugin: [audacity]: ALSA Capture from: Internal Audio Analog Stereo. If it isn't, then select it. (This is the tricky part that took me a long time to discover.)

Airport Express

Airport Express with Pulse Audio

Audio output can be streamed over your local network to an Airport Express. These capabilities require pulseaudio-module-zeroconf (for the Zeroconf/Bonjour networking protocol) and pulseaudio-module-raop (for Airport Express).

  • Install PulseAudio:
sudo apt-get install pulseaudio
Reboot to finish the installation.
  • Select PulseAudio as the output device in
Menu -> System -> System Settings -> Multimedia -> Device Preference
and move "Playback/recording through the PulseAudio sound server" to the top of every category (or at least the ones for which you wish to use PulseAudio).
  • Test some audio (e.g. playback through Amarok) to make sure the PulseAudio system is working. Some applications specifically require that the PulseAudio output is specified in their configuration settings, and some applications require a separate PulseAudio plugin to function properly.
  • Install additional modules in order to use Bonjour/Zeroconf and raop (Airport Express output):
sudo apt-get install pulseaudio-module-zeroconf pulseaudio-module-raop
  • Install utilities to control the preferences and volume of various PulseAudio devices:
sudo apt-get install paprefs pavucontrol
  • Enable discovery of the Airport Express by PulseAudio:
Menu -> Settings -> PulseAudio Preferences (Sound Audio preferences) -> Network Access

and check both:

Make discoverable network sound devices available locally
Make discoverable Apple Airtunes devices available locally
  • It is not clear to me which ports need to remain unblocked in order for Bonjour/Zeroconf and mDNS to discover the AEx. mDNS and Bonjour/Zeroconf use ports 5353, 5000, and 6000. (The PulseAudio server uses port 4713.) However, even when I unblock these the AEx doesn't seem to be able to be discovered until I turn off the firewall completely. (Once the AEx is discovered I turn the firewall back on and then have no other problems). I usually just add the IP address of the Airport Express on the LAN to the list of firewall-allowed connections. (Doing this still doesn't allow it to be discovered, though, for unclear reasons. Still, as long as a connection to the IP address of the AEx is allowed, I can turn the firewall back immediately after the AEx is located by the Zeroconf discovery and everything continues to stream fine.)
  • If your LAN's router allows traffic-shaping (QoS prioritization), giving priority to the traffic to/from the Airport Express can improve performance. Finally, be aware that screensavers can interrupt uninterrupted smooth audio output from a PC. If traffic to the AEx becomes choppy, disable your screensaver.
  • Open PulseAudio Volume Control:
Menu -> Multimedia -> PulseAudio Volume Control
  • If the AEx has been successfully discovered (the firewall may have to be turned off temporarily in order for the AEx to be discovered) the name of the AEx should show up as an Output Device:
PulseAudio Volume Control -> Output Device -> My AEx Name
If desired, the AEx can be set as the default "fallback" output device to always be used:
PulseAudio Volume Control -> Output Device -> My AEx Name -> click "Set as fallback" icon
If it is not set as the default fallback output device, it must be manually selected as an output device each time.
  • Start the application (such as Amarok or Audacious). To manually select which output device should be used, open PulseAudio Volume Control and choose the Playback output device for the application:
PulseAudio Volume Control -> Playback -> ALSA plugin [Amarok]: ALSA Playback on: -> My AEx Name
  • The output volume (for any of the output devices) can be set:
PulseAudio Volume Control -> Output Device -> My AEx Name
Troubleshooting

This was my old method. It works, but is probably unnecessary (and loads a lot of additional modules).

  • Install padvechooser (which also install paman, pavumeter, and paprefs):
sudo apt-get install padevchooser
  • Padevchooser is an applet for the taskbar panel. The PulseAudio Manager is accessible through the applet. Start Manager:
Menu -> Multimedia -> PulseAudio Device Chooser -> Manager -> Devices -> Sinks
  • Select the Airport Express as the output device ("sink"):

My AEx is discovered, but I got no sound through it until I selected it as the default sink (output) by one of two methods:

  • From the PulseAudio Device Chooser:
Menu -> Multimedia -> PulseAudio Device Chooser -> Manager -> Devices -> Sinks
I then noted the name of my Airport Express device to be raop.Base-Station-e60157.local, so I entered that as the sink:
PulseAudio Device Chooser -> Default sink -> Other -> raop.Base-Station-e60157.local

raop-client (Airport Express streaming)

Another method to stream audio to the Airport Express uses raop-client, a tool written in Ruby. See information here.

GSTransmit (Airport Express streaming)

GSTransmit is a tool to allow GStreamer-based utilities to stream output to an Apple AirTunes Device (such as the Airport Express). It is available as a self-installing .deb file from the website.

Airfoil (Airport Express streaming)

You can stream media from a PC running Windows or Mac OS X connected to an Airport Express network to your (K)Ubuntu Linux desktop, using Airfoil. (Unfortunately you cannot send media output from (K)Ubuntu to the Airport Express network with Airfoil, only receive.) This can be useful in a distributed multimedia system, for example, in which your (K)Ubuntu PC is connected to a media center. You must be running Mono. You can download the .deb package at Rogue Amoeba. Installation instructions are at Rogue Amoeba Linux support.

Mice

Activate side-mouse-buttons in FireFox

Adding two lines to xorg.conf will activate side-mouse-buttons in FireFox.

  • This should work with most brands of the 5-button mouse. Here is a list of mice that worked with this instruction.
Logitech MX310
Logitech MX510
Logitech MX518
Logitech MX700
Logitech MX Revolution
Intellimouse Explorer (first edition)
Razer Copperhead
  • Backup X.org configuration file
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
  • Modify the X.org configuration file
kdesu kate /etc/X11/xorg.conf
  • Find the Input Device section for your mouse and add two lines as shown below.
  • You may also increase the number of buttons if your mouse has more than 7 -- just fix the rest of the section based upon the number of buttons.
Note: "back/forward", "wheel click" & "tilt left/right" all count as buttons
  • Change:
Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ExplorerPS/2"
 Option "ZAxisMapping" "4 5" 
 Option "Emulate3Buttons"       "true"
EndSection
to:
Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ExplorerPS/2"
 Option "ZAxisMapping" "4 5"
 Option "Emulate3Buttons" "true"
 Option "Buttons" "7"
 Option "ButtonMapping" "1 2 3 6 7"
EndSection

Touchpad

For Synaptics Touchpads:

sudo apt-get install gsynaptics

For more info, see the Ubuntu help wiki.

Wacom Pen Tablets

Support for the Wacom pen tablet is integrated into Jaunty by default, including for hotplugging. For more info, see the Ubuntu documentation.

Fingerprint Readers

Remote Controls

LIRC (Infrared Remote Controls)

LIRC (Linux Infrared Control) allows you to use most infra-red remote controls. This can be installed from Menu -> Applications -> Ubuntu Software Center -> System -> lirc

or
sudo apt-get install lirc

Remuco (Bluetooth and WiFi Remote Controls)

Remuco is a utility for controlling many multimedia players (such as VLC, Amarok, Rhythmbox, Audacious, and many others) using a Bluetooth or WiFi remote control. Each player has its own package. For example, the VLC package is named remuco-vlc and can be installed:

sudo apt-get install remuco-vlc

Bluetooth

BlueZ is the package that allows Bluetooth connectivity in Ubuntu Linux. This package is included within the current kernel of Ubuntu. To add utilities to check whether your Bluetooth adapter's firmware is current, install:

sudo apt-get install bluez-utils bluez-firmware

then run

sudo dfutool

WiiMote

The Wiimote (Wii Remote Control) uses both Bluetooth and Infra-red technology. It communicates with Ubuntu Linux using the incorporated BlueZ Bluetooth drivers and/or LIRC drivers. (It can function with Bluetooth alone, however.) You will need a Bluetooth receiver on your PC (such as a Bluetooth USB stick or built-in Bluetooth receiver, for example). (Note: not all Bluetooth receivers will work with the Bluez drivers. Check this list or test yours first.)

  • Install the cwiid Wiimote controller package and the lswm Wiimote discovery package:
sudo apt-get install wminput lswm
  • Install the drivers (or just reboot):
modprobe uinput
Note: You can also add uinput to the modules files so it loads automatically at bootup:
sudo echo "uinput" >>/etc/modules

Run (while pressing button 1/2 on the Wiimote):

sudo wminput

For more info, and to learn how to enable the infra-red functions, see this guide.

USB

Wireless Cards

Atheros Cards

Atheros Wireless cards should work automatically with the new kernel by installing the proprietary driver. At installation, after the first reboot, you will be prompted whether to use the proprietary drivers.

It should no longer be necessary to install the following package:

sudo apt-get install madwifi-tools 

These instructions for the Atheros 802.11 b/g integrated card are here for reference only (or if you wish to install them manually instead):

madwifi-hal-0.10.5.6-current.tar.gz
  • Extract the files
  • Make sure your linux headers and build-essential packages are installed:
sudo apt-get install build-essential
sudo apt-get install linux-headers-$(uname -r)
  • Unload any drivers already running.
sudo ifconfig ath0 down
sudo ifconfig wifi0 down
  • Change to the directory where you extracted the driver.
cd <directory_where_driver_unzipped>
  • From that directory, run the installation scripts:
cd scripts
sudo ./madwifi-unload
sudo ./find-madwifi-modules.sh $(uname -r)
cd ..
  • Complete the installation by compiling the source and installing it.
sudo make
sudo make install
  • Add the installed drivers to your system.
sudo modprobe ath_pci

Following this, Network Manager was able to see the wireless card and I was able to configure everything else (WEP / WPA key, etc.) from there.

Complete instructions are available at MadWifi UserDocs.

Atheros AR242x

Alternate instructions for installing the Atheros AR242x card are here.

3G

3G protocols allow wide area cellular communications that include not only cellphone voice transmission but also integrated broadband internet connections. This can be integrated into a single device, or communications can be received through an EVDO adapter. Examples of 3G radio interfaces include Mobile WiMax, CDMA-2000, TD-CDMA, EDGE, and DECT. For info using 3G with the Ubuntu Network Manager, see this page. For additional info on using 3G with Ubuntu, see this guide.

he220r1

he220r1 is a (K)ubuntu driver package for the Huawei e220 USB modem. It has also been found to work with other 3G devices, such as Nokia, Sony Ericsson, and Motorola. See the website for download and installation instructions.

T-Mobile Option 225 (Web'N'Walk) Stick

This website offers a driver optimised for the T-Mobile Web'n'Walk Stick/Option 225.

Virgin Huawei e169

See this Ubuntu forum solution:

sudo gedit /etc/ppp/options

find the line that says:

#-chap

and uncomment it (delete #)

-chap

this (I think) disables CHAP authentication

I also had to change the APN to VirginBroadband instead of VirginInternet which was the default, and now it's happy.

Other settings
Number *99#
Uname <your virgin username>
PW <your virgin password>

EVDO Cards

EVDO cards include USB modems and adapters to receive wide-area cellular broadband Internet connections.

Sprint

Sprint EVDO cards can be used most easily through KPPP. For instructions, read the Sprint Mobile Broadband Setup Guide. Also see the EVDO Forums.

Verizon

See this Crystal Networking guide.

Tethering your PC to your Verizon cell phone

This is a per-minute plan in which you can use Verizon broadband services through your cell phone (such as the Motorola RAZR) connected to your PC via a USB cable. See this guide.

Digital Cameras

WebCams

See the Ubuntu webcam guide for more info. Many webcams that worked in Hardy Heron may not work in Intrepid Ibex. This may be due to a migration from v4l (video for Linux) to v4l2. See this discussion.

EasyCam

EasyCam2 is a utility for finding and installing drivers for your webcam. See these installation instructions.

iSight

Linux drivers for the digital iSight camera (connected by FireWire), using ALSA for sound, are here. The video component is already supported by current kernels (see here for more information).

Luvcview (USB webcam viewer)

Luvcview can be used to view your USB webcam to test it. Install:

sudo apt-get install luvcview

View your webcam:

luvcview -f yuv

Netbooks

Ubuntu can be installed on netbooks. (See this this page for laptop and netbook compatibility reviews.) At this time the Ubuntu Netbook Remix (or equivalent) is preferred to the standard Gnome-based desktop, especially for new users. Ubuntu Netbook Remix is provided to several individual netbook manufacturers (such as Asus and Acer) to be optimised for that device. (You can contact your specific netbook manufacturer for specific details on this product.) If you already have Ubuntu Netbook Remix (or eeebuntu Netbook Remix) installed, you can choose to add the full Ubuntu (Gnome) desktop, if you wish:

sudo apt-get install ubuntu-desktop
  • Asus eeePC 1000H
  • Reduce font size one or two sizes, and set the screen DPI to 120.
  • eeebuntu Netbook Remix is available for this device.
  • Dell Mini 9
  • Ubuntu Netbook Remix runs on this device well. See this guide.
  • HP Mini 1000 Mi
  • A custom edition of Ubuntu is installed on this version of this device. No additional configuration is necessary.
  • Samsung NC10
  • Some package should be installed for keyboard functions (FN Key+functions). The procedure to install these package is available in this forum.

Another method is to install Ubuntu onto your netbook from scratch using a USB flashdrive LiveCD.

Acer Aspire One

There are several Ubuntu-based and other Linux-based OS's specially customised for the Acer Aspire One. Some of them are:

Also see the Ubuntu website for detailed tweaks and fixes. More useful information can be found in the Ubuntu Linux sub-forum at aspireoneuser.com

Palm

Mobile Devices

Ubuntu Linux offers an operating system for Mobile Devices (such as the Samsung Q1 Ultra or Elektrobit MIMD) with a unique and simplified interface. For more information see the Ubuntu MID Edition site.

MP3 / Video Players

Sansa Fuze

The Sansa Fuze is a very high quality MP3 audio as well as video player. It is recognized by default as a USB device in Ubuntu/Kubuntu. To convert videos into a format that can be copied to the player, use Video4Fuze.

  • Download and install:
wget http://video4fuze.googlecode.com/files/fuzemux-0.1_amd64.deb
wget http://video4fuze.googlecode.com/files/video4fuze-0.6_all.deb
sudo dpkg -i fuzemux-0.1_amd64.deb
sudo dpkg -i video4fuze-0.6_all.deb
Use fuzemux-0,1_i386 instead of fuzemux-0.1_amd64.deb if using a 32-bit OS.
  • Start video4fuze from the command line:
video4fuze

or create a menu item with the Command: video4fuze.

  • Convert files (mpg or mp4) using Video4Fuze. Do not use the Sansa Fuze player as the output folder, but use an output folder on your computer. Once the files have been converted, then copy them directly to a Video folder on the Sansa Fuze (using Nautilus in Ubuntu or Dolphin in Kubuntu).
  • I like k9copy to extract something (that I have saved) on a DVD to an mp4 (.avi) first. The Sansa Fuze likes video at 224 x 176 and DivX 4/5, so I extract to those specifications:
Menu -> Multimedia -> k9copy -> Input: DVD -> Output: MPEG-4 encoding -> folder icon: /home/user/Videos
k9configure -> MPEG-4 -> Video -> Codec: MPEG-4 (DivX 4/5) -> Width: 224 -> Height: 176
-> Audio: mp3 (lame) -> Bitrate: 128

I then use video4fuze to convert the extracted mp4 (.avi) into the format that the Sansa Fuze likes.

  • Limitations: At this time Flash videos (.flv) cannot be converted directly by Video4Fuze. You must convert flash videos to another format (such as .mpg or mp4/.avi) prior to Video4Fuze conversion, using a converter such as mencoder or ffmpeg (e.g. with WinFF as the GUI).

MachSpeed Trio

The MachSpeed Trio works natively with (K)Ubuntu Linux. Files can be copied directly to the device from a File Manager (Dolphin or Nautilus).

  • Video formats include .mpg, .flv and .avi. However, the screen is 7.5 cm x 4 cm, which is a 1.875 ratio (widescreen). If your video has a 1.33 ratio (fullscreen), you must add left and right padding to make it look normal. If your video is 320 x 240, for example, you must add left and right padding of 64 each (making it 448 x 240, which is approximately a 1.875 ratio).
In addition, I found I had to convert some videos twice (using ffmpeg) to get it into a format the Trio would accept. For example, I have a 160x120 .avi video I recorded on my camera. (This requires 32 padding on each side instead of 64.) There was a 2 step conversion required to get it into a format the Trio liked:
ffmpeg -i cameravideo.avi -target ntsc-dvd -s 160x120 tempvideo.avi
ffmpeg -i tempvideo.avi -padleft 32 -padright 32 triovideo.avi
The first step does whatever it takes to get the video into a NTSC-compatible format. However, it encodes into the ac3 audio codec, which the Trio doesn't like. The second step converts the audio from the ac3 format to the default mp2 audio format (which the Trio likes better) as well as adds the padding (which in reality can be done in either step). I have tried to simplify this into a single command but haven't figured out how to do it yet.
I then copy the converted file directly onto the Trio, where it plays.

Speech Recognition

For more info see the Ubuntu Wiki -- Speech recognition. Integrated voice recognition is an ongoing project; accumulated information is available at VoxForge.

  • Julius -- open source continuous speech recognition / grammar engine (Japanese only -- does not have an English acoustic module currently). Install:
sudo apt-get install julius julius-voxforge
  • CMU Sphinx -- open source voice recognition software. Install:
sudo apt-get install sphinx2-bin sphinxbase-utils pocketsphinx-utils 

Apps using voice recognition (also see this list):

Networking

Only one network manager and GUI interface can be enabled. Network-Manager is installed by default, but many users prefer Wicd Network Manager.

Network Manager

Network Manager is the network manager installed by default in (K)Ubuntu. It has a tray applet that allows you to switch between Internet connections (such as wireless APs or wired connection).

Wicd Network Manager

Wicd Network Manager is a GTK-dependent networking manager written in Python that can be used in all variants of (K)Ubuntu. Many users (including me) report it to be faster and more stable than Network Manager. To avoid networking conflicts, Wicd requires the removal of Network Manager prior to installation (replace network-manager-kde with network-manager if using Ubuntu instead of Kubuntu).

sudo apt-get remove network-manager-kde
sudo reboot
sudo apt-get install wicd

Set a static IP address

I have never been able to get Network Manager to accept my static IP address settings. If you only use only a wired interface, you do not need a network manager and it can be removed.

  • Remove Network Manager (replace network-manager-kde with network-manager if using Ubuntu instead of Kubuntu):
sudo apt-get remove network-manager-kde
sudo reboot
  • Edit the /etc/network/interfaces file (use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu):
sudo kate /etc/network/interfaces
  • and replace the line (ok if line is missing)
iface eth0 inet dhcp
  • with the following lines (using your own LAN settings, of course):
auto eth0
iface eth0 inet static
address 192.168.0.35
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
  • Then restart networking:
sudo /etc/init.d/networking restart
  • Check to see if your settings are now correct:
ifconfig
  • If you need a static IP address and have a wireless connection, Wicd Network Manager works:
  • Uninstall Network Manager and install Wicd instead (replace network-manager-kde with network-manager if using Ubuntu instead of Kubuntu):
sudo apt-get remove network-manager-kde
sudo reboot
sudo apt-get install wicd

Manual configuration from the command-line

3 steps for WEP:

sudo iwconfig eth[N] essid [SSID]
sudo iwconfig eth[N] key restricted s:[PASSWORD]
sudo dhclient

WPA is more complicated:

sudo mkdir /etc/wpa_supplicant
cd /etc/wpa_supplicant
sudo echo network = { > wpa_supplicant.conf
sudo echo ssid="SSID" >> wpa_supplicant.conf
sudo echo key_mgmt=WPA-PSK >> wpa_supplicant.conf
sudo echo psk="PRESHAREDKEY" >> wpa_supplicant.conf
sudo echo } >> wpa_supplicant.conf
cd /etc/network
sudo gedit interfaces

Now add after "auto eth[N] ..." & "iface eth[N] .." :

wpa-driver wext # or whatever driver your network card needs
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Save the file and restart your system.

Internet connection sharing (DHCP server)

In most LANs, an inexpensive router is used to provide DHCP functions (internet connection sharing).

However, DHCP services can also be provided by a single host computer on your LAN if it is directly connected to the Internet. (This is useful, for instance, if you have a 3G or other wireless EVDO connection to your computer which you want to share with the other computers on your LAN). Other client computers on your LAN would then connect to the Internet through your host computer's Internet connection. The host computer now essentially performs the DHCP functions of a router.

All "client" computers on the LAN ought to be connected to a central LAN switch or router. (If using a router, it should have its own DHCP functions disabled -- you shouldn't have 2 DHCP servers on a LAN unless you know how to nest LANs). They should all be set up to obtain DHCP-assigned dynamic IP addresses and use the same LAN subnet settings (which in the example below is LAN IP range 10.0.0.1 - 10.0.0.250 with netmask 255.255.255.0 and gateway 10.0.0.1). The host computer to be used as the gateway/DHCP server is then connected (through its own ethernet port) either to one to the ports of the switch (if used), or to a LAN port of a router (don't use the WAN port). The host computer then connects directly to the Internet (WAN) through a second port (which in the example below will be a wireless (wifi) port (wlan0)).

(Note: This setup is easiest if you connect all computers on the LAN with Ethernet cables to the central switch or router. But also see using a nested wireless LAN router below.)

(Note: If you want your LAN to use the same subnet as your WAN, see network interface bridging.)

  • Install the DHCP server and firewall programs:
sudo apt-get install dhcp3-server firestarter
  • Rename the startup command (through a symbolic link) for the DHCP server. This is required or Firestarter will not know where to find it:
sudo ln -sf /etc/init.d/dhcp3-server /etc/init.d/dhcpd
  • Edit the DHCP server configuration file:
sudo nano -w /etc/default/dhcp3-server
Change the line
INTERFACES=""
to
INTERFACES="eth0"
  • Restart the DHCP server:
sudo dhcpd restart
  • Right click on Network-Manager -> Edit Connections... -> Wired -> Add
-> Connection name: Shared internet connection
-> IPv4 Settings -> Method: Manual -> Add
-> Address: 10.0.0.1 -> Netmask: 255.255.255.0 -> Gateway: 0.0.0.0
-> Available to all users: [x]
  • Attach the ethernet cable to (eth0).
Network-Manager -> Wired Networks -> Shared internet connection
  • Adjust your firewall to allow the internet connection sharing. Start Firestarter:
sudo firestarter
  • Tell the firewall which port is your direct Internet Connection:

Firestarter -> Preferences -> Firewall -> Network Settings -> Internet connected network device: (wlan0)

-> IP address is assigned by DHCP: [x]
  • Tell the firewall which port is for the LAN, and specify the details for the LAN:

Firestarter -> Preferences -> Firewall -> Network Settings -> Local network connected device: (eth0)

-> Enable internet connection sharing: [x]
-> Enable DHCP for the local network: [x]
-> DHCP server details -> Create new DHCP configuration -> Lowest IP address to assign: 10.0.0.2
-> Highest IP address to assign: 10.0.0.250 -> Name server: <dynamic>
Note: Use your own desired LAN settings (internal DHCP-assigned dynamic IP address range), of course. In this example I don't use the full IP range 10.0.0.2 - 10.0.0.255 for dynamic IP addresses because I want to reserve some LAN addresses (10.0.0.251 - 10.0.0.255) to be used as static IP addresses).
  • Notes:
  • If you wish to use this setup all the time, make the "Shared internet connection" profile your default connection profile in Network Manager.

Using a nested wireless LAN router

Many users will already have an established LAN that uses an existing wireless router and has client computers that are setup to connect wirelessly to the router. Here's how to maintain this setup and still use the internet connection sharing method of a single host computer as described above. This method is known as nested LANs. The wireless router will serve as a nested LAN for its wireless clients (only), but in turn will appear as a single device to the main LAN. The two LANs must have different IP ranges. For example, the main LAN may have an IP range 10.0.0.1 - 10.0.0.255 (with netmask 255.255.255.0), as in the above example. The router's nested wireless LAN must then use a different IP range (for example 192.168.0.1 - 192.168.0.255 with netmask 255.255.255.0).

  • Do not use your wireless router's WAN (Internet) port.
  • Connect the host computer (to be used as your main LAN gateway/router) to a LAN port (not the WAN/Internet port) of the wireless LAN router.
  • Configure your wireless router's LAN so that it appears to be a single device to the main LAN:
  • Setup your wireless router so that the Internet Connection type is "Static IP" (often in the "Internet Setup" section). Configure the settings so that its "Internet IP address" is within the static IP address range of your main LAN (e.g. 10.0.0.254), and make sure the subnet mask matches the one you chose for your main LAN (e.g. 255.255.255.0). The gateway setting should be set to match the IP address of your host computer of the main LAN (e.g. 10.0.0.1 in the example of the preceding section). Now the wireless router will appear to the host computer as just another device on the main LAN.
  • If your wireless LAN is already functioning, you probably don't have to change any settings, but double-check to make sure the schema are compatible. Configure the wireless router's settings for the nested wireless LAN. This is done by enabling the router's DHCP server functions (in "Network Setup" or some similar configuration section of the router). The router ought to have as its own wireless LAN gateway address a "local IP address" (or "LAN IP address") of 192.168.0.1 (for the IP address range used in this example), and a "starting IP address" (for the DHCP-assigned dynamic IP address range to be used for the wireless clients) to be 192.168.0.2 or greater. (Some routers ask you to specify the entire range (such as 192.168.0.2 - 192.168.0.255.)
  • Make sure all your wireless client computers are set to obtain their DHCP-assigned dynamic IP addresses from the wireless router (gateway IP 192.168.0.1) instead of from the main LAN gateway.
  • Now all communications from the wireless client computers will be routed to the wireless LAN router first, which will then in turn route them to the host computer (which is acting as the main LAN gateway/router), which will then in turn route them to the Internet (WAN).
  • Note: The host computer for the main LAN must have a static IP address (e.g. 10.0.0.1 as in the example of the preceding section) and it must match the gateway IP address configured in the wireless LAN router settings.

Network Interfaces Bridging

  • Install bridge-utils to be able to create network bridges:
sudo apt-get install bridge-utils
  • Edit /etc/network/interfaces:
sudo nano /etc/network/interfaces

The interfaces file should look like this after editing it:

auto eth0
iface eth0 inet manual
#
auto br0
iface br0 inet dhcp
#
bridge_ports eth0 wlan0
#
# The loopback network interface
auto lo
iface lo inet loopback
  • Restart networking with:
sudo /etc/init.d/networking restart

Using Dynamic IP addresses for a webserver

Normally, domain name servers (DNS) that are used publicly on the Internet match a web server's URL name with the IP address of the server's host computer. If your computer has a static IP address, then you can publish your own web server's URL as belonging to the static, unchanging IP address of your computer.

However, if your IP address is dynamic (always changing) because you use an ISP (Internet Service Provider) that constantly changes your IP address (using DHCP), then you will need a Dynamic DNS service to constantly keep track of your dynamically changing IP address and match it to of your web server's URL. Fortunately, there are a few Dynamic DNS services that will do this for you, either for a small fee or even for free. For more info, see this Ubuntu Community help article.

For specific tips on setting up Dynamic DNS, see this article.

Filesharing

NFS

NFS is the default networking protocol for network file sharing in *nix systems (including Ubuntu Linux).

Samba File Sharing

Samba client

Samba is a networking protocol that allows compatibility with Windows-based networks. The Samba client is installed by default in Ubuntu and should work seamlessly (unless you have have a firewall blocking the ports).

Samba server

Samba provides file/print services for the SMB/CIFS protocol used in Windows-based networks. See the official Ubuntu documentation for more information about providing services in a Windows network. A Samba server can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:

sudo tasksel install samba-server
  • An alternative method of installation is:
sudo apt-get install samba samba-tools system-config-samba smbfs
Note: samba-tools, system-config-samba, and smbfs are optional.
  • Modify Samba settings.
  • Method 1:
Menu -> System -> Administration -> Samba
(Note: this is available only if you installed system-config-samba.)

It is recommended that your user be a member of the sambashare group, as well.

  • Method 2:
Enable File Sharing Server With User Login (Very Reliable Method)
Do the following on the machine that has the files to be shared:
  • Add current user to Samba:
sudo smbpasswd -a username
(replacing username with your login username)
  • Open the samba config file:
sudo nano /etc/samba/smb.conf
  • Add the directories to be added (right at the end) in the following format:
[Pictures]
path = /home/username/<folder_to_be_shared>
(Replace username with your username and <folder_to_be_shared> with the folder you want to share)
Press CTRL+X and then Y to save.
  • Restart Samba:
sudo service smbd restart
sudo service nmbd restart
Note: Prior versions used:
sudo /etc/init.d/samba restart
  • On Windows access the folder in the following format in Windows Explorer:
\\192.168.x.x
(replace 192.168.x.x with the actual IP address of your server which is serving the folder)
  • On Linux type the following in Konqueror or Nautilus:
smb://192.168.x.x
(replace 192.168.x.x with the actual IP address of your server serving the folder)

Note: If you use Sharing in KDE's System Settings panel, be aware that there is a small bug, reported here. In brief, you need to comment out/delete any instances of these two lines in /etc/smb.conf :

case sensitive
msdfs proxy

Change your Workgroup

To change your Samba (Windows network) workgroup:

sudo nano /etc/samba/smb.conf

Look for the line:

workgroup = WORKGROUUP

and change the setting to whatever your LAN workgroup is.

Recognizing Win98 machines

Microsoft networking is extremely quirky. To enable recognition of PCs with Windows 98, edit your Samba configuration file:

sudo nano /etc/samba/smb.conf

Then add the following lines to the file:

[global]
# THE LANMAN FIX
client lanman auth = yes
client ntlmv2 auth = no

Integrating into Mac OS X Network

See this guide for information on integrating Ubuntu into an existing Mac OS X Appletalk network.

FTP Server

An FTP server allows the easy transfer of files between systems over the network. Clients such as Filezilla can be used to interact with an FTP server. Also see these FTP tips.

vsftpd

vsftpd is an FTP server available in (K)Ubuntu. For configuration information, see the official Ubuntu documentation. Install:

sudo apt-get install vsftpd

proftpd

Proftpd is an FTP server available in (K)Ubuntu that can be used with either the MySQL or PostgreSQL database. Also see the Ubuntu Community documentation. Install:

sudo apt-get install proftpd-basic

WebDAV

WebDAV is a method for allowing remote access to local folders via an HTTP-based web browser or file manager. This can be combined with user authentication (using LDAP or other password mechanism).

Local Area Network

Modems / Dial-up

Network Manager does not accept modem connections. See Ubuntu help for information on identifying and connecting with a modem. These instructions require gnome-network-admin (install while connected to a wired ethernet connection):

sudo apt-get install gnome-network-admin

Gnome PPP and wvdial

Gnome PPP is a discontinued GUI frontend for the wvdial PPP modem dialer. It is still available as a package. Install:

sudo apt-get install gnome-ppp wvdial

See this forum thread for tweaks required to make Gnome PPP and wvdial operational in Lucid.

GPPP

GPPP was the default modem dialing application in previous versions of Ubuntu.

Menu -> Applications -> Internet -> GPPP Internet Dial-up

Remote Access

There are several methods of remote access. VNC sharing allows you to view and control a remote computer's desktop. (Windows users use a similar proprietary protocol called remote desktop protocol (RDP)). XDMCP allows a complete remote X-windows based login. Remote connections are hazardous unless proper security precautions are taken to prevent unauthorized logins and to ensure encryption of transmitted data.

SSH

Secure Shell or SSH is a network protocol that allows data to be exchanged over a secure channel (or "tunnel") between two computers. Encryption provides confidentiality and integrity of data. The OpenSSH client is installed by default in Ubuntu so you can connect to another computer that is running an SSH server.

Connect to a remote SSH server

From the command-line terminal

Install the OpenSSH client (if not already installed):

sudo apt-get install openssh-client

From the command-line Terminal type:

ssh -C <username>@<computer name or IP address>
Note: The -C option indicates compression, which speeds up transmission through the tunnel.

For example:

ssh -C joe@remote.computer.xyz
or:
ssh -C mike@192.168.1.1
or
ssh -C 192.168.1.1 -l mike
Note: -l specifies the login id.


If the SSH server is listening on a port other than port 22 (the default), you can specify that in your connection (with the -p option). For example, if the SSH server is listening on port 11022, connect:

ssh -C joe.friday@remote.computer.xyz:11022
or
ssh -C remote.computer.xyz -p 11022 -l joe.friday

If you have made a public/private key using ssh-keygen, the private key must be stored in /home/user/.ssh. The key should be accessible only to user

sudo chmod 600 /home/user/.ssh/identity
or
sudo chmod 600 /home/user/.ssh/id_rsa 

To login with the key:

ssh -C remote.computer.xyz -p 11022 -l joe.friday

Note: You can run the command as a menu item, but the command must be "run in terminal."

Port forwarding through SSH

  • In brief, use
ssh -C <remote ip> -p <SSH tunnel port> -L <local port>:<remote computer>:<remote port> -l <user>

This specifies that any communications from your computer (localhost) going out through <local port> will be transmitted securely through the the SSH tunnel port. To use VNC through the tunnel, you would use an application like Krdc or Vinagre:

krdc vnc://localhost:<local port>

Note: localhost is equivalent to (and interchangeable with) 127.0.0.1. Either can be used.

Note that for VNC, the default <local port> is 5900. In general, a remote VNC server (such as X11VNC) is also listening on the default <remote port> 5900 as well. The default <SSH tunnel port> is 22, as discussed above. All these can be changed, however, if you desire greater security.

For me, I noticed that I had to set <remote computer> to be the internal LAN IP address of the remote computer (such as 192.168.1.155) instead of the remote router's IP address, which is specified in <remote IP>. (If the remote computer has a static IP address (i.e. is directly connected to the Internet without an intervening router), then <remote computer> and <remote ip> would be the same.)

Example: For extra security, my SSH Server uses <SSH tunnel port>=11022. I want to VNC to a remote computer on a remote LAN with a router whose IP address is <remote ip> = 244.205.123.123. The remote computer to which I want to connect has a static IP address within the remote LAN of <remote computer> = 192.168.1.155. I have set up an X11VNC server on this computer that is listening on <remote port> = 6912 (instead of the default 5900). I setup port forwarding on the router of this remote LAN to forward port 6912 to this server computer. I want to VNC to this remote computer from my laptop, through the Internet. My laptop VNC client (Krdc) will use the default <local port> = 5900. My name is <user> = joe.friday. This is my story.

ssh -C 244.205.123.123 -p 11022 -L 5900:192.168.1.155:6912 -l joe.friday
krdc vnc://localhost:5900

If you have set up a private/ public key pair with a passphrase, or if your SSH server requires a passphrase, of course, you will be prompted for the passphrase after issuing the SSH command.

Note: Port forwarding assumes that the ports are also forwarded through the router(s) and through any firewalls. See the documentation for your router(s) and firewall to learn how to do this. The advantage of SSH tunneling is that only the <SSH tunnel port> needs to be open and forwarded by a router. All encrypted communications will go through your router using this single port. This is what makes the communications secure.

PuTTY

PuTTY is a GTK-based GUI client-interface for SSH connections and eases the setup for port forwarding, SSH public key authentication, and automated login. A user would run Putty to create the SSH tunnel (instead of the ssh command) and then run a program such as Krdc or Vinagre. PuTTY is available for both Linux and Windows (but for routine Linux usage OpenSSH is generally recommended instead).

sudo apt-get install putty putty-tools
  • To create a 2048-bit RSA key pair compatible with OpenSSH, it is possible to use Puttygen (part of Putty-tools). (For me the Linux version of Puttygen is occasionally buggy, however, so I recommend OpenSSH keygen for routine usage instead):
puttygen -t rsa -b 2048 -O private -o putty_rsa.ppk
puttygen putty_rsa.ppk -O public-openssh -o id_rsa.pub
puttygen putty_rsa.ppk -O private-openssh -o id_rsa
  • Move the OpenSSH-compatible keys to the ~/.ssh (i.e. the /home/user/.ssh) folder
mv id_rsa* ~/.ssh
  • Copy the public key ( /home/user/.ssh/id_rsa.pub ) to the server that is hosting the OpenSSH server, into the /home/serveruser/.ssh (for whichever user is the administrative user for the server -- generally the user that installed the server initially). If the SSH tunnel is (still) set at default port 22, you can copy the key using the utility:
ssh-copy-id serveruser@remoteserver.computer.xyz
  • Connect a VNC client (such as Krdc) through SSH using the command-line:
putty -ssh -i ~/.ssh/id_rsa -l serveruser -L 5900:127.0.0.1:5900 remoteserver.computer.xyz -P 22
krdc vnc://127.0.0.1:5900
or as a single command:
putty -ssh -i ~/.ssh/id_rsa -l serveruser -L 5900:127.0.0.1:5900 remoteserver.computer.xyz -P 22 sleep 5; krdc vnc://127.0.0.1::5900
  • Alternatively, the PuTTY SSH Client GUI can be run (from Menu -> Internet -> PuTTY SSH Client) and options configured from there.

Using keys created by Puttygen in OpenSSH

The public security key generated by Puttygen in Windows is generally not compatible with OpenSSH security keys unless it is edited. For example, the default OpenSSH key is 2048-bit RSA (SSH-2). When a 2048-bit RSA (SSH-2) PuTTY public/private key pair is generated (by Puttygen) in Windows (see this tutorial), the public key looks like:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20100302"
AAAAB3NzaC1yc2EAAAABJQAAAQEAjdp567qxsGkhELlMQup2mXHdsveCWq/maU6k
unPpbkwEuhkasuOrhkAWgv5v3d8S857zdHcfnXWi2FkEaJuFxqpJ2IkFuvqRdqYD
ZCcASj2S0LoXdWpC4uon6VH8oBT31r+wkDfmI2a+K74jgXjtm1BWWxwOpKaWQHi9
YItbY/06renRex34n3ejO20JRqD/BxnFU7ND41Szo3ZMKoa0yzhevU2ntt74BCvC
bYFHdSoRbi3AH8qGInzFfhXPdrG8qA382ZKEh5Bmy8Qxb9Uen/+jjP51YxN/ykee
RwSrdSCZekB6jN6uuTLNDEXJSJizqlPU8tROqf3pYv1kxzD9bw==
---- END SSH2 PUBLIC KEY ----
  • To be used by OpenSSH, the saved public key must be edited.
  • Delete the first two lines (with the BEGIN and Comment: in them) and the last line.
  • Join the remaining lines into a single line.
  • Place ssh-rsa at the beginning.
  • It should end up looking like:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAjdp567qxsGkhELlMQup2mXHdsveCWq/maU6kunPpbkwEuhkasuOrhkAWgv5v3d8S857zdHcfnXWi2FkEaJuFxqpJ2IkFuvqRdqYDZCcASj2S0LoXdWpC4uon6VH8oBT31r+wkDfmI2a+K74jgXjtm1BWWxwOpKaWQHi9YItbY/06renRex34n3ejO20JRqD/BxnFU7ND41Szo3ZMKoa0yzhevU2ntt74BCvCbYFHdSoRbi3AH8qGInzFfhXPdrG8qA382ZKEh5Bmy8Qxb9Uen/+jjP51YxN/ykeeRwSrdSCZekB6jN6uuTLNDEXJSJizqlPU8tROqf3pYv1kxzD9bw==
  • Once the PuTTY public key is in this format, it can be appended to the ~/.ssh/authorized_keys file on the OpenSSH server. (The private key stays on the client computer, of course). PuTTY can then connect (from Windows or Linux) to an OpenSSH server using the public/private key method.

Connect using SSH Agent

With SSH Agent you can automate the use of public key authentication and open an XDM or VNC session using a script. See this tutorial.

Also see this alternative simple approach: Connect with SSH and start an application with a single command.

Setup an SSH server

Install the OpenSSH server:

sudo apt-get install openssh-server
or
sudo apt-get install tasksel
sudo tasksel install openssh-server

Note: The OpenSSH server can also be installed when doing a server installation as an option from the LiveCD.

Note: An OpenSSH server can also be set up on a Windows server using Cygwin. See these instructions.

  • Don't forget to forward the port on which your OpenSSH server is listening. The default SSH port is 22; if the default is used, the router should therefore forward port 22 to the computer on the LAN that is hosting the OpenSSH server. The OpenSSH listening port can be changed; in fact, each computer on the LAN can listen on its own unique SSH port, if desired. The router must forward each specified listening port to the correct computer. Therefore, if computer 1 has its OpenSSH server set to listen on port 22221, then the router should forward port 22221 to computer 1's LAN IP address. If computer 2 has its OpenSSH listening port set to 22222, then obviously the router must forward port 22222 to computer 2's LAN IP address. To change the listening port of the OpenSSH server, edit the /etc/ssh/sshd_config file (use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu):
sudo kate /etc/ssh/sshd_config

and change the listening port from 22 to your desired listening port:

Port 22221

then restart the OpenSSH server:

sudo /etc/init.d/ssh restart

Limit authorized SSH users

OpenSSH Public Key Authentication

See this OpenSSH Public Key Authentication Tutorial.

In brief, it is necessary to generate a public / private key pair. On your client machine, generate the pair:

ssh-keygen

A prompt asks for a passphrase. If you wish to use OpenSSH without a password from a secure client (to which no one but you has access), leave the passphrase blank. If you enter a passphrase, you will be asked for this passphrase each time you use the SSH client. By default, a 2048-bit RSA SSH-2 key pair is generated and stored in the /home/user/.ssh folder. The private key is named id_rsa and is meant to stay in that folder. (The public key is id_rsa.pub and is meant to be copied to the OpenSSH server.)

  • The private key must only be accessible (and should be read-only) to user, the owner of the file:
chmod 600 /home/user/.ssh/id_rsa
You could also make the entire .ssh folder accessible only to user:
chmod 700 /home/user/.ssh
  • Copy the public key ( /home/user/.ssh/id_rsa.pub ) to the server that is hosting the OpenSSH server, into the /home/serveruser/.ssh (for whichever user is the administrative user for the server -- generally the user that installed the server initially). If the SSH tunnel is (still) set at default port 22, you can copy the key using the utility:
ssh-copy-id serveruser@remoteserver.computer.xyz
  • The ssh-copy-id utility only works over port 22. An alternative if you have changed your SSH port is to copy the /home/user/.ssh/id_rsa.pub key to the server manually. On the server make sure the directory /home/serveruser/.ssh exists and that there is a file authorized_keys (with write privileges) in that folder. If not, create such a file while logged into the server as serveruser (the touch command creates an empty file):
mkdir ~/.ssh
cd ~/.ssh
touch authorized_keys

Then concatenate the id_rsa.pub key you have copied to the ~/.ssh folder. (Make sure the owner of id_rsa.pub, after copying, is serveruser.):

cd ~/.ssh
chown serveruser id_rsa.pub
cat authorized_keys id_rsa.pub >> authorized_keys
  • Make sure the OpenSSH server knows to look for the key file. On the remote server, edit the OpenSSH configuration file:
sudo nano /etc/ssh/sshd_config
  • Uncomment the line (i.e. remove the # at the beginning of the line):
#AuthorizedKeysFile %h/.ssh/authorized_keys
  • Remove the ability to login to the OpenSSH server using password authentication:
 sudo nano /etc/ssh/sshd_config
  • Change the line
#PasswordAuthentication yes
to
PasswordAuthentication no
  • Restart the OpenSSH server:
sudo /etc/init.d/ssh restart
  • Now you can connect securely with an SSH tunnel without requiring a password, logging in as serveruser.
ssh -l serveruser -L 5900:127.0.0.1:5900 remoteserver.computer.xyz -p 22

Connect with SSH and start an application with a single command

  • If you have created an OpenSSH key pair (without a password), you can start both the SSH tunnel and a VNC program (such as Krdc or Vinagre) to run through the SSH tunnel with a single command:
ssh -f -l serveruser -L 5900:127.0.0.1:5900 remoteserver.computer.xyz -p 22 sleep 5; krdc vnc://127.0.0.1::5900
  • Alternatively (and probably preferably) you can create a Menu Item / Shortcut with the above command.

Note: This command is a command-line mini-script. The SSH option -f option tells the SSH client to fork into the background after starting. (This option is not available in the PuTTY client.) This allows the command line to continue to proceed to the next command(s) listed on the command line mini-script. The 5 second wait ("sleep") timeout allows time for the SSH tunnel to be created before proceeding to the next command. (This can be lengthened if necessary.) After the wait period, the program (Krdc VNC in this example) is started.

  • Of course, any program could be started (to be run through the SSH tunnel) in this fashion, not just a VNC program.

Automate SSH connections that require a password

This method is strongly advised against. Transmitting an unencrypted password through the Internet (in order to establish an SSH connection) invites password sniffing. Use the OpenSSH key pair methods described above, instead. This method is listed here for reference.

  • Terminal interactions (such as the SSH password challenge) can be automated using the expect utility. Install:
sudo apt-get install expect
  • If, for example, your SSH client ID is clientuserID, yourpassword is not#1sostrong, and the remote SSH server is remoteserver.computer.xyz (using the default SSH port of 22), then use this command to start the SSH tunnel:
expect -c 'spawn ssh -l clientuserID -L 5900:127.0.0.1:5901 remoteserver.computer.xyz -p 22; expect assword ; send "not#1sostrong\n" ; interact'

There are other parameters in this example. 5900 and 5901 are the ports to be used on either side of the tunnel (port 5900 is used for VNC, for example). See Port forwarding through SSH for more details.

You can use the entire command as a menu item (must be "Run in terminal" in the Advanced menu options).

VNC

Virtual Network Computing (VNC) mirrors the desktop of a remote ("server") computer on your local ("client") computer (it is not a separate remote login, as is XDMCP). A user on the remote desktop must be logged in and running a VNC server (such as X11VNC, Vino, or Krfb). Keyboard and mouse events are transmitted between the two computers. VNC is platform-independent —- a VNC viewer on one operating system can usually connect to a VNC server on any other operating system. (Windows users can use one of several clients such as UltraVNC Viewer.)

Vino Remote Desktop VNC server

Vino-server (the Gnome VNC server) is included by default in Ubuntu. Start:

Menu -> System -> Preferences -> Remote Desktop
  • You can accept uninvited connections in the Security section. You can require a password for these connections.
  • This implementation of Vino does not allow changing the default listening ports (which start at 5900). If you wish to customize your VNC connection, use X11VNC instead.

How to securely use VNC with SSH tunneling

It is less secure to leave the VNC listening port open to the Internet, even with a password. (This can expose you to password cracking attempts.)

It is more secure to use SSH to tunnel your VNC connection. Under SSH port forwarding, the VNC listening port is the <remote port>. To increase security, this listening port can be changed from the default 5900. Only the VNC server and the SSH client need to specify the <remote port> in a secure connection.

X11VNC Server

While Vino is easy to use, X11VNC allows far more customization and therefore can be used more in situations where greater security is needed.

  • Install an X11VNC server to share your desktop with other computer:
   sudo apt-get install x11vnc
  • Run X11VNC without a password:
x11vnc -forever -rfbport 5900
Note: -rfbport 5900 specifies the port to listen on. The port number can be changed. This option is not required if the default port 5900 will be used. Don't forget to open/forward this port in your firewall/router. By default X11VNC server exits after the first client disconnects. To keep it running (and allow future connections), use the -forever option. See here for more command line options.
  • Create a password to use with X11VNC:
mkdir ~/.vnc
x11vnc -storepasswd YOUR_PASSWORD ~/.vnc/x11vnc.pass
  • X11VNC can then be started with a password:
x11vnc -forever -rfbport 5900 -rfbauth ~/.vnc/x11vnc.pass -o ~/.vnc/x11vnc.log -loopbg -display :0
  • You can create a startup script so that X11VNC is automatically loaded at startup (with password settings):
echo "/usr/bin/x11vnc -forever -rfbport 5900 -rfbauth ~/.vnc/x11vnc.pass -o ~/.vnc/x11vnc.log -loopbg -display :0" > ~/.config/autostart/x11vnc.sh
chmod +x ~/.config/autostart/x11vnc.sh
  • You can test the startup script:
~/.config/autostart/x11vnc.sh

Using VNC with SSH

See Port forwarding through SSH for additional information.

Vinagre VNC client

Vinagre is the default Gnome-based VNC client used in Ubuntu.

  • Menu -> Applications -> Internet -> Remote Desktop Viewer

Terminal Server Client

The Terminal Server Client is an Ubuntu/Gnome frontend for rdesktop (for RDP connections to Windows computers) and one of several vncviewer clients (for VNC connections). In can be used instead of Vinagre.

  • Menu -> Applications -> Internet -> Terminal Server Client
  • To use it with VNC, one of the VNC clients must be installed first. For example, install the TightVNC client:
sudo apt-get install xtightvncviewer
  • Note that the TightVNC client can be used from the command line (or as a menu item) directly:
vncviewer 192.168.0.12::5900
where 192.168.0.12 is an example host location that is running a VNC server on port 5900. For more command-line options, use
man vncviewer

Krdc VNC client

Krdc is the default VNC client in Kubuntu/KDE but can be used in GNOME. It can be used for both VNC and RDP connections. Installing it will also install the Qt platform and many KDE utilities (a large download).

sudo apt-get install krdc
  • Run:
Menu -> Applications -> Internet -> Krdc
  • The command-line connection (for use as a menu-item, for example) is:
krdc vnc://<remote IP>
  • If the remote (Krfp) VNC server is using a <remote port> other than the default 5900 port, use
krdc vnc://<remote IP>:<remote port>
  • Krdc can also connect to a Windows server using RDP (Remote Desktop Protocol).
krdc rdp://<remote IP>:<remote port>

Using a VNC client with SSH

See this howto for an automated setup using a script (it did not work for me, but it might for you).

In brief, you would initiate an SSH tunnel with port forwarding using Putty or the command line:

ssh -C <remote ip> -p <SSH tunnel port> -L <local port>:<remote computer>:<remote port> -l <user>
then you would start a VNC client such as Krdc:
krdc vnc://localhost:<local port>

<local port> will usually be the default 5900, in which case you could simply use

krdc vnc://localhost

XVNC4Viewer VNC Client

XVNC4Viewer is an alternative to Vinagre or the Terminal Server Client (vncviewer). Install:

sudo apt-get install xvnc4viewer

Automatic user login (for use with VNC)

VNC only works if a user is logged in. When a computer (hosting one or more servers) is intended to start up unattended and VNC (with or without SSH tunneling) is to be used, the computer ought to start with the primary user logged in. To accomplish this:

Menu -> System -> System Settings -> Login Manager -> Convenience -> Enable Auto-Login (ticked) -> Lock session (ticked)
-> Pre-select user: Specified: Choose primary user (i.e. the user hosting the SSH tunnel, if any, and the VNC server)
-> Automatically log in again after X server crash (ticked)
  • Also make sure the VNC server is set to Autostart at bootup.

FreeNX

FreeNX is a remote desktop display server/client solution that natively incorporates SSH tunneling (unlike VNC). It is therefore more secure than VNC (unless VNC is coupled with SSH tunneling).

FreeNX Server

The Free server .deb package can be downloaded from No Machine free server downloads.

sudo add-apt-repository ppa:freenx-team
  • Install the package:
sudo apt-get update
sudo apt-get install freenx

FreeNX Client

Download the self-installing .deb file from No Machine Client downloads.

XDMCP

XDMCP allows a separate remote login by an authorized user. This login is separate from the local user.

  • XDMCP is not secure over the Internet and should only be used within a LAN. It cannot be tunnelled through SSH. It is turned off by default in Ubuntu. To enable it, edit the configuration file:
gedit /etc/gdm/custom.conf
  • Find and change (or add) the line from false to true so that it reads:
[Xdmcp]
Enable=true

Telnet

SSH is, basically, secure Telnet.

VPN clients

A VPN (Virtual Private Network) allows a secure encrypted connection ("tunnelling") over the Internet between a client (either standalone or on a separate LAN) and a home or corporate LAN server.

VPN through Network Manager

  • The default Network Manager in Ubuntu/Kubuntu has a VPN client available. This includes support for IPSec and Cisco-compliant VPN connections. Install:
sudo apt-get install network-manager-vpnc
  • To connect to a VPN network using OpenVPN (SSL), install the plugin:
 sudo apt-get install network-manager-openvpn
  • To connect to a VPN network using PPTP (MS Windows servers), install the plugin:
sudo apt-get install network-manager-pptp
  • Configure:
Network Manager icon (in system tray) -> VPN Connections -> Configure VPN

vpnautoconnect (vpn daemon)

vpnautoconnect is a daemon to allow automatic vpn connections through Network Manager. Download and install the .deb package for your OS version.

Other VPN clients

Standalone VPN clients based on protocol are available (but not necessary if using Network Manager):

  • vpnc, grml-vpn -- for Cisco-compliant (IPSec) VPN networks
  • openswan -- for IPSec (OpenSwan) VPN networks
  • pptp-linux -- for PPTP (MS Windows-compliant) VPN networks
  • openvpn, gadmin-openvpn-client -- for OpenSSL (OpenVPN) VPN networks

VPN servers

OpenVPN

OpenVPN is a free, GPL-licensed open-source cross-platform VPN solution based on OpenSSL (not IPSec). Install the server (then see the website for further installation instructions):

sudo apt-get install openvpn bridge-utils

A GUI configuration utility (GTK-based) is available:

sudo apt-get install gadmin-openvpn-server

Also see these installation tips.

Poptop (PPTP Server)

Poptop is a free open-source PPTP-based VPN server compatible with MS-windows PPTP clients. Install:

sudo apt-get install pptpd

OpenSwan

OpenSwan is the open source implementation of IPSec-based VPN connections for Linux (and is a successor to FreeSwan). Install:

sudo apt-get install openswan linux-patch-openswan

Security

Ubuntu by default is a fairly safe system. However, if you intend to use Ubuntu as a server, or for critical applications in which loss of data (by accident or by malicious intrusion) would be disastrous, you should learn how to make Ubuntu more secure. A good introduction to Ubuntu Security Best Practices is available. Recommended reading includes the book Cyber War by Richard Clark and this interview with Joe Weiss (IT advisor for the energy-sector smart grid).

Firewall

Network communications go through "channels" called ports. You can restrict which ports are available ("open") for network communications, creating a barricade to unwanted network intrusion. Firewalls do this job for you. But I guarantee that if you install one before you know how to use it that one or more networking programs on your system will stop working. Read every bit of documentation about a firewall before installing it -- you won't regret the time invested. All of these packages modify iptables, which is the set of rules that controls network access in and out of your computer. (You can modify iptables manually from the command line, as well, but if you are that much of an expert, you probably don't need this guide.) Also see the official Ubuntu documentation.

Firestarter

Firestarter is an intuitive firewall manager used to set the iptables values which provide firewall capabilities in Linux (including Ubuntu). It has a very easy-to-use GUI.

sudo apt-get install firestarter

Firestarter fails to open system log

This is a problem in Oneiric. See the solution here.

Guarddog

Guarddog is a GUI firewall configuration utility that has been used for KDE. It has a complex array of configuration, and is difficult to use for some beginners.

sudo apt-get install guarddog

Uncomplicated Firewall

Uncomplicated Firewall is installed in Ubuntu by default, but all ports are open initially. It is configurable through the command-line interface. See this forum thread, or this usage tutorial, or Ubuntu community help for tips on how to set up and use it. If not installed, it can be installed:

apt-get install ufw

Gufw

Gufw is a graphical user interface for Uncomplicated Firewall. Install:

sudo apt-get install gufw

Anti-virus

  • If you are running a file server, interface frequently with Windows drives or share files with Windows users, or use virtualization, you will want a virus checker for your Windows files.
  • Despite extensive minsinformation, Linux is not immune from malware (witness the explosion of malware being created for the Linux-based Google Android systems). The malware is not usually spread within the OS itself (as long as the OS is a well-respected distribution obtained through official channels), but in trojan programs downloaded and installed by users outside of the normal software distribution channels (i.e. repositories) of the OS. There is always a danger to using programs downloaded from the Internet from sources other than respected repositories -- it is the primary reason that Debian and (K)Ubuntu retain tight control over their software repositories.
  • Any file can have malware embedded in it (which is trivial to achieve by concatenation, for example: cat originalfile.avi malware.exe > originalfileplusmalware.avi). The question is whether a user will try to open a file with a program (such as a media player) that has been compromised in a way that allows it to execute the code found in the infected media (e.g. .avi) file. This can occur not only for Windows users but for any OS (including Mac OSX and Linux) with a compromised program (e.g. media player).
  • Routine scanning of any file downloaded from the Internet, any file imported from another user's computer (even a trusted source, since their attention to virus prevention may not be as compulsive as yours), or any attachment received in an email (even from a trusted sender) should be done with an anti-virus program.

ClamAV

ClamAV is the open source virus tool for Linux. To install ClamAV:

sudo apt-get install clamav
  • If an error is returned: "The database directory must be writable for UID 1000 or GID 1000" in order for the virus database to be updated, then change the ownership of the installation directory (/var/lib/clamav):
sudo chown 1000 /var/lib/clamav

ClamTk (ClamAV GUI)

ClamTk is a GTK-based GUI frontend for ClamAV. Install:

sudo apt-get install clamtk

AVG

AVG offers a free virus scanner for Linux in a .deb package. Download and install from the website.

Avast

Avast offers a Linux edition (for home users only) in a .deb package. Download and install from the website.

Anti-spam

Spam Assasin

SpamAssasin is written in perl, and is mostly for use with a server (such as a groupware server or Apache). Install:

sudo apt-get spamassassin

Rootkit checkers

Rootkits are malicious trojan-like programs to allow an intruder to become a root user and therefore have complete administrative control over the system. There aren't many rootkits in the wild for Linux. Still, this is a growing security problem (especially in other operating systems) and it is a matter of time before more rootkits appear in Linux. Checking for rootkits isn't always successful from a system that is already infected. Your rootkit checker should therefore be run from another system, or a USB pendrive with an Ubuntu LiveCD installation. See the rootkit checker manuals for instructions how to do this. If you are infected with a rootkit, you must backup all your files and re-install your system. (Thank goodness this is easy with Ubuntu, unlike with other operating systems).

Chkrootkit

Chkrootkit checks locally for signs of a rootkit. See the chkrootkit manual for usage instructions.

Install:
sudo apt-get install chkrootkit
Run:
sudo chkrootkit

Rootkit Hunter

Rootkit Hunter is compatible with (K)Ubuntu systems. See the usage instructions.

Install:
sudo apt-get install rkhunter
Run:
sudo rkhunter

Malicious commands to avoid

There are many malicious commands to be avoided in Linux (as in all operating systems). It is worthwhile to be aware of these dangerous commands so that they are not executed by accident or by malicious advice.

USB drives

USB drives are a major source of security risk and means of data theft.

  • An administrator password should be set for the computer BIOS and booting from a USB drive or CD/DVD should be disabled. (Otherwise, any passerby can boot their own OS and then use it to steal data from the hard drive.)
  • See this article for methods of restricting USB usage to authorized users.

Prevent unauthorized boots and system access

Many computers are kept in places where casual passersby may have an opportunity to access the computer, unobserved for short periods. In addition to physical precautions to prevent or slow computer theft (such as locked cases, alarms, and security cables similar to those used to slow bicycle theft), precautions should be taken to prevent an unauthorized operating system from being booted using an external device (such as USB drive). Once such as external OS is booted, it can be used to access most hard drive(s) on the computer and the contents copied to a second external device (to be examined or unencrypted later). This is a common means of data theft that is fast and easy to accomplish, and means to deter it should be taken on any public or semi-public computer.

  • Set BIOS to restrict bootup to the hard drive only.
  • Set a Supervisor/Administrator password for your computer's BIOS. (I recommend writing it down and taping it to the inside cover of the computer case prior to locking the computer case.) Disable booting from all devices except the hard drive. Setting the hard drive as the first priority boot device is not enough, as most current BIOS menus allow manual selection of any enabled boot devices. Only the hard drive should be left enabled.
  • Enable Hard Drive locking, if your computer's BIOS allows it. Most hard drives allow a password to be set by the BIOS and stored in a chip on the hard drive controller which can only be reset by disassembling the hard drive. (Some manufacturers provide a backdoor security key, however.) BIOS versions found on newer computers/laptops allow this password to be set in the BIOS, so that only a BIOS containing the correct password can unlock the hard drive. (If the hard drive is then removed from the computer, it cannot be accessed by any BIOS that does not have the correct password or backdoor security key.) Note, however, that this precaution does not protect against booting from external devices if the BIOS is still set to allow that.
  • There is a risk to this security measure. If you forget the password and the BIOS passwords somehow get reset, the hard drive would become inaccessible. The BIOS and Hard Drive password(s) should always be stored in a safe location.
  • Password protect the Grub bootloader. Without password protection, Grub can be used to circumvent BIOS restrictions. See this section for Grub Legacy and this section for Grub2.
  • Make sure all user accounts are protected by a password, and always require passwords for login. Never create an "administrator" user account (hidden or not) and leave it unprotected by a password. Never enable automatic login without a password to any user account.
  • It is possible to enable automatic login to a preferred password-protected user account while simultaneously enabling a password-protected screensaver (the password for which must still be entered even before initial user access). This is a reasonable solution that offers protection while still allowing automatic login.
  • Make sure a password-protected screensaver is always enabled (that will engage after a reasonably short period of inactivity).

Network Monitors

There are two types of network monitors: those that monitor your own system's network settings and those that monitor network traffic. The latter includes security tools (that can also be used as hackers tools) for exposing security weaknesses in a network. Be aware and be safe! A list of available tools is at Top Ubuntu Security Tools.

Netstat

Netstat is the Linux command-line tool to monitor network status and functions. There are many usage parameters. See the manual for help.

netstat

Etherape (Network monitoring)

EtherApe is a graphical utility that allows you to see (in real-time) where connections are being made on your network, or between your network (or computer) and the Internet. If you are experiencing unexpected network activity on your computer or LAN and wish to see where the activity is occurring, this is an easy tool to use. Both "local" user and "root user" installations are created; in general you must use the root user installation to see all your network traffic.

sudo apt-get install etherape

List open files

Sometimes you will see your network slowing and want to know which files are sending data over ports. Use this command:

lsof -i -n -P

Nmap

Nmap is a free open source utility for network exploration (including showing open ports and running services) and security auditing. Install:

sudo apt-get install nmap

Scan your own PC:

nmap localhost

(Once you have found out which ports are open, use a firewall to close the ones you don't want open.)

Nmap GUI

Install:

sudo apt-get install nmapfe
or you can try Zenmap:
sudo apt-get install zenmap

Nessus

Nessus is a proprietary comprehensive vulnerability scanning suite that is free for personal, non-enterprise usage. See the website for details.

Snort

Snort is the de facto open source standard for intrusion detection. Install:

sudo apt-get install snort

It can be used with an MySQL database (sudo apt-get install snort-mysql) or with a PostgreSQL database (sudo apt-get install snort-pgsql).

AcidBase

AcidBase is an intrusion detection / basic analysis and security engine that uses Snort. Install:

sudo apt-get install acidbase

AppArmor

AppArmor is a set of security enhancements developed by Novell for SUSE Linux. It is installed in (K)ubuntu by default.

Disable AppArmor

AppArmor can prevent some services from running as expected and cannot be used in conjunction with SELinux. To disable it:

/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils

SELinux

SE Linux (Security Enhanced Linux) is an NSA (US National Security Administration) recommended set of tools for enhanced security in Linux systems. It enforces strict access controls (privileges) and is meant for mission-critical installations. It is not suitable for the casual desktop user. It was first available in Hardy Heron and is being updated for Intrepid Ibex. It is not compatible with AppArmor (which must first be removed).

sudo apt-get install selinux

Knockd (Port security)

Knockd is a small server that listens for a pre-defined sequence of port opening attempts (a "knock") before opening an otherwise closed firewall port for communications. Install:

sudo apt-get install knockd

Network Management

Monitor your network or datacenter with a framework of utilities. Comparable to IBM Tivoli (which can cost thousands of dollars), these solutions are generally available as either community or enterprise editions.

  • Hyperic is an open-source network monitoring framework that can be used in either a datacenter or a cloud environment (it is used for Amazon Cloud). Both a free community version and a subscription enterprise version are available.
  • Groundwork OpenSource offers a community edition that integrates other packages such as Nagios, Nmap, and others. There is a subscription enterprise version as well. It has its roots in a university setting.
  • OpenQRM is the GPL-licensed, free open-source community successor to the very popular network monitoring solution Qlusters. It is available as a Debian/Ubuntu package. See the website for details.
  • Canonical offers the Landscape network management service for $150 per node, with a free trial available.
  • Zenoss is a commercial network monitoring subscription package (about $150/node) with a limited free "core" edition also available.

Nagios

Nagios is a free open source network monitoring solution. It is administered from a web interface (http://localhost/nagios) and is expandable using a large number of available plugins. For additional configuration information, see the official Ubuntu documentation. Install:

sudo apt-get install nagios3

Munin

Munin is a free GPL-licensed open source networking monitoring tool based on RRDTool, in which a master network node queries other network resources, cataloging and graphically displaying changes. It has a web interface and multiple plugins. For additional configuration information, see the official Ubuntu documentation. Install:

sudo apt-get install munin

Cacti Monitoring Server

Cacti is a complete, free open source network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. It uses MySQL and PHP (part of the LAMP server stack). All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices. For more info see Cacti Server Setup. Install:

sudo apt-get install cacti

Cluster SSH

ClusterSSH allows replication of a command on an administration console to be replicated via SSH to multiple computers in a cluster. Install:

sudo apt-get install clusterssh

Enterprise Network Firewall

IPCop

IPCop is a free open source (GPL-licensed) firewall solution for use as an independent appliance (on a dedicated PC) in an enterprise network. It allows remote management and can protect multiple servers, including web and email servers. IPSec-based OpenVPN is supported. The CD image .iso and other files can be downloaded here. Installation instructions are on the website.

SmoothWall

SmoothWall Express is an award-winning, free, open source (with a GPL license) firewall solution for use as an independent appliance (on a dedicated PC) in an enterprise network. Download the installation CD .iso image here (server OS included), burn onto a CD, and install on a new, dedicated PC. Many features, however, such as VPN server, database access authentications, and content filtering are only implemented in a commercial version, however, and are not available in the community version.

Endian

Endian is a very robust, free, open source universal threat management appliance similar to IPCop and Smoothwall. It also incorporates OpenVPN. Like Smoothwall, Dansguardian is used for content filtering (and is included in the community edition). Commercial and hardware versions with some additional features, automatic updates, and professional support are available. See the website for details.

LTSP (Thin client support)

LTSP (the Linux Terminal Server Project) adds thin-client support to Linux servers. The package is free, GPL-licensed, and the client can be used to run programs on either Linux or Windows LTSP servers. There is a module for classroom management (ltsp-controlaula) as well. Installation instructions are here. The alternate LiveCD can also be used to install a terminal server, as indicated in these instructions.

LTSP Server

Install:

sudo apt-get install ltsp-server ltsp-manager

LTSP Client

Install:

sudo apt-get ltsp-client

iTALC (Thin client for Education)

iTALC is a free, open source (GPL-licensed) thin client solution that supports both (K)Ubuntu Linux and Windows XP. It has been used widely in educational settings to monitor, share, and control multiple workstations. See the website for download and installation instructions.

Internet Cafe software

Internet Cafe (or CyberCafe) software is specialized LAN-administration software that includes time usage monitoring, billing, and administration. It can also be used in schools, libraries, and organizations with multiple monitored workstations requiring usage limits.

OutKafe

OutKafe is a free, open-source, GPL-licensed cybercafe solution based on a postgreSQL database server stack. It is run on hundreds of sites. It is GTK-based but can be run with Kubuntu (KDE).

OpenKiosk

OpenKiosk is a free open source multi-platform server/client solution for administering and monitoring groups of workstations, such as in libraries, school labs, and internet cafes. Installation is from source files. See the website for details.

CafePilot

CafePilot is a free multi-platform Java-based server/client solution for real-time monitoring and billing of Cybercafe workstations. A complete custom Ubuntu-based LiveCD server/multiple-client solution (including OS and many applications for unlimited workstations) is available for $100 here.

Miscellaneous solutions

This thread discusses several other solutions, including:

Pessulus (Lockdown Editor)

Pessulus is a GTK (Gnome)-based utility that allows an a computer administrator to restrict acccess to several administrative functions, including the command-line Terminal and many other functions. This is useful on public kiosk PCs, for example. Install:

sudo apt-get install pessulus

Cluster (cloud) computing

A warning about distributed computing

Cloud computing is often mistaken for remote hosting. While cloud computing using public hosts may be beneficial in "farming out" a few of your non-sensitive computing needs, the recent ease of cloning filesystems and the promiscuity of datacenters has placed a great deal of sensitive data at risk when databases and critical server functions themselves are remotely hosted at a site not under your complete control. Even "trusted" banks and other large businesses routinely trade and sell our sensitive "private" data to multiple partners (sometimes for profit and sometimes unwittingly). Hosted servers are compromised on a daily basis and it is not very easy for an end customer to know how effective are the security practices of a remote hosting service. Further, any data left on public storage devices (cloud servers) in the US for more than 180 days are subject to search and seizure by government agencies there. Therefore, it is almost always more secure to host your own server(s) in house and to limit the traffic and access to your databases and servers to members of your own organization. Learning how to run your own servers is worth the effort, and powerful hardware on which to run them is inexpensive these days.

The Ubuntu cloud computing environment allows you to recruit the multiple computers within your own organization for distributed ("cloud") computing and thereby keep it all "in house" (behind secure firewalls). You do not need to expose your organization to insecure remote public hosts in order to use cloud computing.

BOINC (Berkeley Open Infrastructure for Network Computing)

BOINC is middleware software developed at UC Berkeley to allow multiple computers to operate as a grid-based (cloud based) supercomputer. There are over half a million computers participating in BOINC projects. To install BOINC and participate in one or more of these projects:

sudo apt-get install boinc

Servers

Many server packages (such as Apache2, MySQL, PHP, etc.) can be installed individually, on either a Desktop edition or a Server edition (using the tasksel command described below). It is not necessary in general, therefore, to install Ubuntu Server if you only wish to use an occasional server package on a Desktop edition. Most of the instructions for individual server packages will work on the Server edition, on the Desktop edition, or on a Server edition that has had an Ubuntu or Kubuntu desktop installed on it.

Nevertheless, the Server edition is optimised for speed and ease of monitoring and maintenance when implemented in large networks and is therefore recommended. (For complete information see the Ubuntu Server Guide.) It is always possible to add an Ubuntu (Gnome) or Kubuntu (KDE) GUI desktop to an Ubuntu Server at any time.

(If you are attempting to create a dual-boot or multi-boot configuration with multiple operating systems on your computer, then see these tips.)

(Tip: During installation of the server, an initial user / password is created. Many servers are intended to run unattended with little subsequent intervention and it can be easy to forget the original user / password pair that is created at installation. I suggest writing this information down and taping it to the inside of the computer case cover for later reference. (Lock the computer case if you desire extra security.))

There are many server packages that are available to be installed as a one-step process during the Server edition installation process from the LiveCD, or at any time (on most editions) using the tasksel command. For a list of server packages that can be installed using the tasksel command:

sudo apt-get install tasksel
sudo tasksel --list-tasks
or using a GUI list:
sudo tasksel

Ultimate Server Walkthrough

  • Using instructions from Ubuntuguide, an ultimate server can be created with two wikis (MediaWiki), two Drupal websites, a Moodle online learning website, a BigBlueButton teleconferencing server, an Ubuntu desktop, and dynamic DNS access from the web. All components can be expanded and/or additional servers added.
  • Lucid ultimate server walkthrough.
  • Original Jaunty ultimate server walkthrough.

Add a desktop to an Ubuntu Server

Packages that require server capabilities (such as Drupal with Apache, etc.) are often happier when a Server edition is installed as the base OS. However, adding a desktop can make the administration and maintenance of many packages easier for many users (albeit with a cost of reduced server speed). Add an Ubuntu (Gnome) or Kubuntu (KDE) desktop to a server using:

sudo apt-get install ubuntu-desktop
or
sudo apt-get install kubuntu-desktop

LAMP server installation

During server installation, you will have the option of installing a LAMP (Linux, Apache, MySQL, PHP) server stack. Many (but not all) open source servers use this integrated server stack. Drupal, for example, needs to have a LAMP server installed. If you intend to install a groupware server, however, make sure it is compatible with a LAMP server stack before choosing this option. Many groupware servers will install LAMP (or their own variation) automatically, so you do not need to install the LAMP stack. Others will install and use postgreSQL instead of MySQL, so you would not need to install a LAMP server.

Apache2 + MySQL + PHP

This is the preferred method:

sudo apt-get install tasksel
sudo tasksel install lamp-server

(Tip: During installation of the LAMP server, an initial MySQL "root" user password is created. This information will sometimes be needed when installing other server packages that use MySQL. I suggest writing the MySQL password down and taping it to the inside of the computer case cover for later reference. (Lock the computer case if you desire extra security.))

Other servers

During server installation, you can choose other servers to install, as well. These include a Mail server (Postfix with Dovecot), a DNS server (bind9), the OpenSSH server, a print server, a Tomcat Java web server, a Samba file server (for use with Windows networks), and a virtual machine host (Xen). Again, if you are using a groupware solution, you should be careful about installing these services, as they may conflict with similar (but competing) servers which the groupware solution will install by default.

eBox (server and network manager)

eBox is a web-browser based server management platform that is useful in managing multiple servers and networking functions in a small to medium business. It is modular so that as the network grows and more networking functions or servers (such as the ones listed below) are added, eBox can manage those, as well. Install:

sudo apt-get install ebox

OpenSSH server

OpenSSH allows encrypted communications through a designated secure port. See setting up an SSH server.

Mail Server

There are two methods for setting up a mail server.

  • The dovecot-postfix package install the components and configuration files to use the Maildir (mail spooling) folder system by default. See Dovecot-Postfix Mail server.
  • The mail-server task installs the components and configuration files to use the mbox (mail spooling) system by default. This can be installed:
sudo tasksel install mail-server

Bind9 (DNS server)

BIND DNS servers are the most commonly used on the Internet. Bind9 is the current edition. See the usage instruction here. Also see the official Ubuntu documentation for more configuration information. It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:

sudo tasksel install dns-server

Apache Tomcat (Java server)

Tomcat is a free open source platform from Apache which provides a "pure Java" HTTP web server environment for Java code to run (see here for more info).

It is not part of the Apache2 web server. See the official Ubuntu documentation for more configuration information. It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:

sudo tasksel install tomcat-server

Xen virtual machine host

Xen is a free open source virtualization platform that allows the host to run "guest" operating systems simultaneously (see here for more info). Xen implementation in the (K)ubuntu server is based on integration with KVM, the kernel-based virtualization platform in Linux. KVM integrates with QEMU components, which have been merged with Xen.

Note: KVM requires a 64-bit processor with a virtualization extension, i.e. an Intel VT or AMD-V CPU, therefore this package currently is successful only with the 64-bit Ubuntu server installation and on those CPUs.

It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:

sudo tasksel install virt-host

Print server

Ubuntu uses the CUPS print server, which is integrated into the desktop. Installing a print server in Ubuntu Server is necessary only if you do not intend to use a desktop (i.e. you intend a "headless" server). It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:

sudo tasksel install print-server

OpenLDAP

OpenLDAP is a community-based LDAP server that allows directory querying over TCP/IP, generally for organizations arranged by domain. Ubuntu uses the slapd daemon for the OpenLDAP server. See the official Ubuntu documentation for more information about installation and setup.

Proxy server

Squid

Squid is a widely-used proxy web server and web cache daemon that is useful for corporate or other large LANs that wish to accelerate and/or control traffic through the LAN. For initial configuration information, see the official Ubuntu documentation. Install:

sudo apt-get install squid

Privoxy

Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. It is easier to configure and more useful for individual users. Install:

sudo apt-get install privoxy

Reverse proxy Servers and Load Balancers

A reverse proxy server allows incoming web traffic on a LAN to be directed to multiple computers (each running one or more servers) on the LAN. When redundant instances of a server exist on a LAN, a Load Balancer allows traffic to be directed to the most available instance.

Pound (Reverse proxy and load balancer)

Pound is a free, open source (GPL-licensed) lightweight reverse proxy and load balancer. Also see the Ubuntu Community instructions. Install:

sudo apt-get install pound

Apache Reverse proxy

The Apache2 server has a mod_proxy module available that enables reverse proxies. See these instructions for a simple method to implement reverse proxies using this Apache module.

Control panels

There are several free and/or GPL-licensed control panel utilities for managing multiple servers on a single physical server or cluster of servers running Debian/Ubuntu-based servers. Here is a brief overview.

  • Webmin is the most widely used web browser-based free open source web hosting control panel for Linux.
  • GNUPanel is a free GPL-licensed web hosting control panel system that is compatible with Debian/Ubuntu OS using PHP.
  • Web-cp.net is a free GPL-licensed web hosting control panel system that is compatible with Debian/Ubuntu OS using PHP.

Network Attached Servers

FreeNAS

FreeNAS allows a PC with several hard drives to function as a self-contained network attached storage RAID device. It is a very small, fast system, so that an older PCs could function quite well as an NAS.

Setup RAID in Ubuntu/Kubuntu

See this thread for a discussion how to set up RAID on an Ubuntu/Kubuntu server.

Databases

There are several free enterprise-strength databases that can be used in (K)Ubuntu Linux.

PostgreSQL

PostgreSQL is a free standards-compliant enterprise-strength open-source database, initially developed at UC Berkeley. See the PostgreSQL Server documentation for server configuration information. Install using the dummy task:

sudo tasksel postgresql-server
or install directly:
sudo apt-get install postgresql-8.4
or
sudo apt-get install postgresql

MySQL

MySQL is one of the most widely-used relational databases, and has been licensed under the GPLv2. It has now been bought by Oracle as part of the purchase of Sun. It has long been integrated into co-ordinated server platforms using the LAMP stack, but it can also be installed separately.

sudo apt-get install mysql-server

Tips & Tricks

Run Command

You can run any application in your path using the Run Command. Use Alt+F2.

Turn off Hot Keys

This is the most evil option on any operating system, in my opinion. A mis-stroke enables any number of random events. Unfortunately, this problem is pervasive in operating systems and is difficult to turn off.

Menu -> System -> Administration-> Advanced -> Input Actions -> General Settings -> check "Disable KHotKeys daemon"
Menu -> System -> Administration-> Advanced -> Input Actions -> Gestures Settings -> check "Disable mouse gestures globally"

If you wish to be selective about it (this doesn't often work, however), start by disabling unnecessary desktop hotkeys.

Menu -> System -> Administration-> Advanced -> Keyboard & Mouse -> Keyboard Shortcuts

Also, you may want to deactivate linking gestures to sticky and slow keys:

Menu -> System -> Administration -> Accessibility -> Activation Gestures -> uncheck "Use gestures for activating sticky keys and slow keys"

Note: You probably will have to disable hotkeys in many applications, as well.

Hotkeys from the Synaptics Touchpad can be selectively turned off using this information from the Ubuntu documentation.

Associate default applications

Menu -> System -> Administration-> Advanced -> File Associations -> x-content -> video-dvd -> Applications Preference order -> Add...
then choose your favourite media player. There are similar options for Blu-Ray (video-bluray) and HD DVD (video-hddvd). Set each individually.
  • To assign the default player for playing mpegs (or other video formats):
Menu -> System -> Administration-> Advanced -> File Associations -> video -> mpeg -> Applications Preference order -> Add...
then choose your favourite media player. You can do this for a host of video file formats, including .wmv (x-ms-wmv, or Microsoft WMV format), .flv (x-flv, or Flash video), quicktime, and so on.
  • To assign .pls audio streams to play through Audacious:
Menu -> System -> Administration-> Advanced -> File Associations -> audio -> x-scpls -> Applications Preference order -> Move Audacious to the top (or Add... it).
Make sure *.pls appears in the Filename Patterns section.

Automatic user login

  • To accomplish this (yet still require a user password):
Menu -> System -> System Settings -> Login Manager -> Convenience -> Enable Auto-Login (ticked) -> Lock session (ticked)
-> Pre-select user: Specified: Choose primary user
  • This ought to be combined with a password-protected screensaver.

Autostart a program at bootup

Any program (or script) can be made to Autostart at bootup by creating a symbolic link to that program (or script) in the ~/.config/autostart folder.

For example, to start Firefox at bootup, create a symbolic link:

sudo ln -s /usr/bin/firefox ~/.config/autostart

Choose Bootup/Startup services

Preventing unneeded or unwanted services from loading at startup can improve system performance.

  • Install the GTK-based Bootup-Manager:
sudo apt-get install bum
  • Run Bootup-Manager:
Menu -> System -> Bootup-Manager

Run a script from a menu item

It is possible to place a short script in a menu item / shortcut to answer an interactive query (such as a password query). Here is an example that is used to enter a password during an SSH negotiation. First, install the utility expect:

sudo apt-get install expect

The use a command in the Menu Item / Shortcut similar to:

expect -c 'spawn ssh -l sshuser -L 5900:127.0.0.1:5900 remoteserver.remotedomain.org -p 22 ; expect assword ; send "sshpassword\n" ; interact'

In this example the password sshpassword is returned when the ssh program requires a password. Expect waits for some text to be displayed in the command-line terminal then returns text in return. The Menu Item must be "Run in terminal", therefore.

SHC (Encrypt scripts)

SHC is a simple script compiler that will convert a script into a binary, obscuring the code (and passwords, etc.). Usage instructions are here. Install by adding the Debian Etch repository:

sudo add-apt-repository 'http://archive.debian.org/debian etch main' 

then install the shc package:

sudo apt-get install shc

Capture a screenshot

See this tutorial.

Customize desktop to look like KDE

In recent versions of Ubuntu, the Gnome desktop can be made to resemble the cleaner KDE desktop with some customization. (Customizations are highly personal, and this section represents preference only.)

Run a KDE 4 desktop from Ubuntu

It is possible to install the KDE4-based desktop (the default in Kubuntu) in Ubuntu.

apt-get install kubuntu-desktop

There is a risk of software bloat and some incompatibilities between modules when doing this. At login, you can choose (as an option) whether to start the KDE (Kubuntu) desktop or the Gnome (Ubuntu) desktop. Nevertheless, when there are two modules trying to perform the same function (one from each desktop), it is possible to have conflicts.

Run a KDE 3 desktop from Ubuntu

You can also install the older KDE 3 desktop on Lucid, or almost any KDE3 application.

  • Add the following KDE 3 repositories:
sudo add-apt-repository ppa:kde3-maintainers
  • Install KDE 3.5 desktop:
sudo apt-get update
sudo apt-get install kubuntu-desktop-kde3
  • To install any KDE3 app, append "-kde3" suffix to package name. See Pearson Computing for additional details.

Kill (end) a process

  • There are many tricks to try to fix a frozen PC. Press Alt+F2, and use killall to end the frozen application. Example:
sudo killall amarok
sudo killall firefox
  • In order to terminate a stuck graphical application use the xkill utility. Press Alt+F2, type xkill, and press Run. Point the cursor to the application you want to kill and press the left mouse button. This should kill the selected application.
xkill
  • Another trick to try is pressing AltGr+SysRq+K (RightAlt+PrintScreen+K). This will log you out. But, what happens if this does not work? Try pressing Ctrl+Alt+F1,login, enter your password and run:
sudo killall gdm
sudo startx

View hidden files

In the Nautilus file manager, press:

Ctrl+ H

Mute notifications (alerts)

  • Notifications (alerts) can be disabled:
Menu -> System -> Preferences -> Sound -> Sound Effects -> Sound theme: -> No sounds -> Close
  • GNOME notifications (alerts) are associated with sounds by default. This can also be disabled separately:
Alt-F2 -> gconf-editor -> /apps/indicator-sound -> volume_mute (ticked)
  • Turn off login notification sound:
Menu -> System -> Preferences -> Startup Applications -> Startup Programs -> GNOME Login Sound (unticked) -> Close
-> Menu -> System -> Administration -> Login Screen -> Unlock -> Play login sound (unticked) -> Close

Random password generator

  • Pwgen is a command line utility to generate a block of random passwords. Run it from Konsole (in Kubuntu) or Terminal (in Ubuntu). Install:
sudo apt-get install pwgen
  • Run pwgen:
pwgen
  • UUIDgen is a default utility to generate a random UUID. Run:
uuidgen

The random UUID can also be used as a password, if desired.

Password checker and enforcement

John the Ripper is a free open source password cracker that uses a dictionary of over 4 million commonly used passwords in many languages. Because this tool this widely available, it is useful for scanning and securing your own LAN and computers for password strength. Install:

sudo apt-get install john
  • Passwdqc is a module to enforce password strength. Install:
sudo apt-get install passwdqc

MD5Sum

To check the MD5 sum of a file, use this command in the command line:

md5sum filename

Filenames with spaces

  • Filenames or folder names with spaces in them should be enclosed with parentheses (" "). For example, to change to a directory named "This Dir" or "/home/This Dir", use the command:
cd "This Dir"
or
cd /home/"This Dir"
  • Alternatively, a space in a filename or folder name can be preceded with a backslash. For example, to change to a directory named "This Dir" or "/home/This Dir":
cd This\ Dir
or
cd /home/This\ Dir

Alien

Alien is a method for converting (Red Hat) .rpm packages into (Debian) .deb packages. It is not reliable and converted packages must be tested extensively for functionality, with line changes often required. It is often more reliable to create (Debian) .deb packages from source, and even the Alien software maintainers do not recommend using Alien for important packages. To keep alien from changing the version number, use the following command

alien -k rpm_file_name.rpm

Convert the package.rpm into a package.deb

alien -d package-name.rpm

Convert the package.rpm into a package.deb, and install the generated package

alien -i package-name.rpm

To convert .rpm to debian

sudo alien -k *.rpm

Software Troubleshooting

Permissions error on program startup

If you get a permissions error, try the following:

sudo chown -R user /home/user 
Note: Replace user with the actual username. This command changes the owner of the folder /home/user to user. -R means "recursively", i.e. including all subfolders.

CD-ROM Troubleshooting

If you receive the "cdrecord has no permission to open the device" error while burning using a CD burner, open a terminal and type:

 sudo chmod 777 /dev/scd0
Note: replace "/dev/scd0" with your own device.
Note: chmod 777 is the universal option for granting full permission to a folder. The 777 mask indicates that read, write, and execute permission is given to all users.

Licenses

Linux is largely a community of volunteers and as such represents one of the largest altruistic efforts on earth. This includes companies who decide to contribute their own software into the public domain for free use. The continued success of sharing depends on licenses that keep software free and usable for anyone who wants to use it. However, there must be a method for Linux users and developers to make money, as well. Licensing helps protect each of these efforts. See the Wikipedia Free Software Licensing article and the GNU operating system licensing page for more complete information.

  • Kubuntu Derivatives do not need a license, according to its developer. See this blog article.

GPL license

The GPLv3 license (and the Affero GPLv3 license for network-based software) intends that the software module or package is free to use in any environment, and furthermore, any software that relies on that GPLv3-licensed module must in turn also be completely free. Commercial and proprietary software packages can't use or incorporate GPLv3-licensed modules.

LGPL license

The Lesser GPL license intends that the software module or package is free to use in any environment, including in commercial and proprietary software packages. This allows companies to develop proprietary packages which includes LGPL-licensed modules, from which they can make a profit. The disadvantage is that their products (which benefit from the LGPL-licensed modules) are not required to be in the public domain in turn. (Many companies often later donate their entire package into the public domain, however, after they no longer make a profit from them.)

ODbL license

The ODbL (Open Database License) is a "share alike" open license intended for databases.

Apache license

The Apache license has been around a long time. It is compatible with the GPLv3 license, but, unlike the GPLv3 license, it does not require modified software to retain the Apache license. In other words, Apache-licensed software can be modified and the modified software then made proprietary (and therefore not returned to the open source community).

BSD license

The BSD license is similar to a public domain license. There are currently many confusing iterations of the BSD license, however, mostly regarding attribution notices and advertising that is required to be provided along with any software derivatives. The BSD license allows the option of propagation of either (otherwise-licensed) free open source restrictions or proprietary restrictions. It therefore allows a mix of (otherwise-licensed) proprietary modules and open sourced-licensed modules to co-exist in the same package. This flexibility has made the BSD license popular with complex distributions (such as the (BSD Unix-based) Mac OS X operating system, for example).

Creative Commons licenses

Espoused by many large public-domain projects, there are a variety of Creative Commons copyright licenses for different scenarios. Many variations impose "non-free" limitations and versions prior to version 3 were denounced by several large open-source projects; particular variations of this license must be examined closely.

Proprietary licenses

There is a vast array of proprietary licenses, all different. You never know what your limitations for software are unless you read every word. Most are attempts by lawyers to have an opportunity to create a lawsuit in the future. Some may be called "free" licenses but have many limitations which you will not be aware of until you are in the middle of a lawsuit. No license outside of the GPLv3 license is recommended. Be careful when committing your organization to a mission-critical software package with a proprietary license. Also see this outstanding article on the Open Source Enterprise Trap.

Requests

eBook version of this guide

  • See the Books Category for free Ubuntu eBooks based on this help guide.
  • There is an option in the menu bar at the left entitled "Printable version" which formats pages for easier printing. You can print this (or any other document) to a PDF file easily. By default, Ubuntu includes a "Print to File" option from its Print menu. Use this option to print anything appearing in your browser into a PDF file. From Firefox (or any other browser or program):
File -> Print -> Print to File -> Output Format: PDF

Import this guide into another wiki

  • How do I import a copy of Ubuntuguide into my own wiki?
See this page.

Reviews

Other requested topics

Place your requests here.

  • How can I sponsor Ubuntuguide/Kubuntuguide?
  • How can I contribute?
Register and then add your suggestions directly to the wiki.

Public Service Announcement

------------
  • Support Earth Day all year long and do your part to reduce energy consumption (and CO2 emissions) and help reduce the rate of global warming. Support organisations that work to limit world overpopulation. Consider a low-power computer, such as those from Aleutia or Fit-PC. Maybe browse a news website dedicated to energy efficiency, such as Environmental Leader...

     ... and plant some trees.

------------


This guide is maintained at the Linux Center of the University of Latvia.
Please help test and perfect this guide. To edit pages you need to register.


Boot from a Live CD

To boot from any CD (Including LiveCDs), you must make sure that your BIOS bootup settings allow this. This is usually changed from the BIOS setup menu. The BIOS bootup menu is usually accessed during the first few seconds after powering on your computer.

The BIOS setup access key is often displayed on your screen (often it is the F2, Delete, or F10 key), depending on your BIOS. Further, most recent BIOS's allow a one-time choice of the bootup medium, so that either a CD or USB can be chosen as the bootup medium on a one-time basis (without changing the regular BIOS settings).

If the BIOS on your computer does not allow a one-time bootup-medium choice and you must change the regular BIOS settings temporarily, then enter the BIOS setup menu and hunt around for the settings for Bootup device priority (sometimes in the Advanced Setup menu). Make sure your CD/DVD optical drive is listed as the first boot device, before the hard drive.

If you intend to use a LiveUSB installation instead of a LiveCD, then set the boot order so that the USB drive is listed first, before the hard drive. (Obviously, your BIOS must allow booting from a USB drive for this option to be available.)

Once you have installed all your operating systems from the LiveCDs or LiveUSBs (or finished using other bootable LiveCDs or LiveUSBs such as GParted), you can reset the first bootup device to be the hard drive again.

After installation, most security experts then recommend restricting bootup to the hard drive only. A BIOS password should also be created so that the BIOS bootup settings cannot be changed by a casual passerby. In this manner a casual passerby will not be able to boot their own LiveCD or LiveUSB onto your computer (and thereby potentially change your computer without your permission).

UEFI

If your computer, device, or hardware uses UEFI instead of a BIOS bootup system, then see this page.

Coreboot

If your computer, device, or hardware uses Coreboot instead of a BIOS bootup system, then see this page.

Multiple OS Installation

These instructions are for installing more than two operating systems on your hard drive. If you only need two operating systems (such as a Windows installation and a (K)ubuntu Linux installation), it is easiest to just use the (K)ubuntu installer to do it for you (as detailed on the main page).

Warning: As of version 9.10 (Karmic Koala), the (K)Ubuntu Desktop edition LiveCD installer uses Grub2 (which is difficult to customize) and does not allow the specific steps needed in this tutorial. DO NOT USE the Karmic Koala Desktop edition LiveCD for installation if you have a dedicated boot partition, use more than 2 operating systems, or chainload bootloaders. The (K)ubuntu Desktop edition LiveCD installer will overwrite your Master Boot Record and you will then be forced to re-create it later. This is a flaw in the LiveCD installer of Karmic Koala. Install the Alternate CD edition instead, or even the Ubuntu Server edition (and then add the ubuntu-desktop afterwards).

Warning: During installation of 10.04 (Lucid Lynx) and later, there is an advanced option (Ready to install -> Summary -> Advanced) to choose whether to install the GRUB2 bootloader into both the partition into which the (K)Ubuntu OS is installed as well as the Master Boot Record MBR) or just to install it into the partition into which the (K)Ubuntu OS is installed (only). If your system uses a boot partition, uses multiple OS (more than 2), or chainloads bootloaders then pay careful attention during this step. For systems with boot partitions that have already been configured (and to which the Master Boot Record already refers to as the partition which contains the initial bootloader), it is best not to overwrite the MBR during any OS installation.

  • Example, from the Desktop version GUI installer, a point in the installation will be reached:
Ready to install -> Summary -> Advanced -> Device for boot loader installation: /dev/sda6

In this example, this setting will cause the GRUB2 bootloader to be installed into /dev/sda6 only (the partition into which the new (K)Ubuntu OS is being installed). The MBR (Master Boot Record) will not be changed. However, if the default setting of /dev/sda were to be chosen, GRUB2 would not only be installed into partition /dev/sda6 (into which the (K)Ubuntu OS is installed) but also the MBR (designated as /dev/sda) would be changed. The copy of GRUB2 stored in /dev/sda6 wwould then be designated by the MBR as the master bootloader for all Operating Systems on the entire computer. This is undesirable if you wish to use a master bootloader (such as Grub Legacy stored in the boot partition) instead of GRUB2.

Introduction

  • If your computer, device, or hardware uses UEFI instead of a BIOS bootup system, then also see this page.
  • If your computer, device, or hardware uses Coreboot instead of a BIOS bootup system, then also see this page.

The method described here involves creating a small boot partition in which to store a set of Grub bootloader configuration files. (These files will be created during the first Ubuntu Linux OS installation and then copied to the boot partition where they can subsequently be edited.) The initial Grub menu will always be kept in this small boot partition. Each operating system will then keep its own set of bootloader configuration files within its own partition. The Grub menu residing in the boot partition will be only be used to chainload the specific bootloader files stored in the partition of whichever operating system is chosen from the menu (no matter whether the chosen operating system is a Windows, Mac, (K)ubuntu, or other Linux operating system).

Each operating system can therefore use the bootloader/configuration file that is peculiar to it, storing it in its own partition. If the kernel, filesystem, or even the bootloader files for that operating system changes (within its own partition) for any reason, it will not affect the kernel, filesystem, or bootloader files of the operating systems stored in the other partitions. It will also not affect the primary bootup menu (stored in the boot partition), and each operating system will be able keep its own independent bootup process intact.

This avoids a common problem with many operating system installers (including Ubuntu) which attempt to impose a single bootloader on all the operating systems residing on a hard drive. The installer overwrites the Master Boot Record so that it only points to the bootloader installed with that operating system (within that operating system's partition). When this happens, the bootloader files can only be edited while running that particular operating system and cannot be adjusted by any other operating system. Further, after this happens several times (following multiple OS installations), it eventually becomes difficult to remember which partition has the bootloader configuration files that the Master Boot Record points to. With the chainloading method, you don't have to worry about that, any longer. The Master Boot Record will be set to point to the bootloader configuration files stored in the boot partition at all times. Once this is set up, the Master Boot Record need never be changed.

Here is some info about this method:

Using Grub Legacy for the boot partition

This method uses Grub Legacy as the bootloader to be installed to the boot partition (because it is the easiest to customize). Starting with Karmic Koala 9.10, however, Ubuntu/Kubuntu uses Grub 2 (instead of Grub Legacy) by default.

  • An easy and fast method is to use an Ubuntu Server edition 9.04 LiveCD (which uses Grub Legacy) to install the first instance of Ubuntu Linux (and Grub Legacy). Use the minimal install (i.e. don't install any extra packages), in the interest of speed. Proceed with the installation instructions that install Grub to the Master Boot Record, as well as installing a second copy of Grub Legacy to the local partition. Then copy the Grub Legacy settings to the boot partition as described. Edit the Grub Legacy menu settings stored in the boot partition so that chainloading to each planned partition is enabled.
Once this is finished, re-install a newer version of Ubuntu/Kubuntu to the same partition (overwriting the 9.04 server version). However, this time do not allow the new installation process to overwrite the Master Boot Record. (We want the Master Boot Record always to use Grub Legacy, not Grub2.) Install Grub2 (this time) to the local partition only. This method is described in further detail below.
  • A second method involves installing (K)Ubuntu completely (using the LiveCD installer), then removing Grub2 from the (K)Ubuntu partition. Grub Legacy is then temporarily installed in its place and copied to the boot partition. The Master Boot Record is set to refer to this copy of Grub Legacy stored in the boot partition. After this has been done, Grub Legacy is then removed from the (K)Ubuntu installation (but left in place in the boot partition) and Grub2 re-installed in the (K)Ubuntu partition's /boot directory once again. This method is described in further detail here.
  • Now the Master Boot Record will always use Grub Legacy (stored in the boot partition) merely as a chainloader to each subsequent partition, where that chosen partition's particular bootloader will be run directly from within the partition (no matter if it is a Windows partition's bootloader, a (K)Ubuntu partition's bootloader (e.g. Grub2), or a Mac partition's bootloader).

Partition design

Three primary partitions and one extended partition are allowed on your hard drive. The extended partition can be divided into a very large number of logical partitions. Each Windows installation will need to be installed on a primary partition. All the Linux (including Ubuntu/Kubuntu) installations, though, can (and should) exist in logical partitions, so you can have as many as you want. The swap partition, also, can (and should) live on a logical partition.

The easiest way to do this is to use the GParted Live CD as a partition manager, or using the GParted application directly from the Ubuntu LiveCD (Menu -> System -> Administration -> GParted) or KDE Partition Manager from newer versions of the Kubuntu LiveCD.

  • At the minimum you will need:
  • one primary partition for each Windows OS
  • an extra small primary partition (which can be resized later, in case is needed). If a Windows boot partition exists as a second NTFS partition, it should be left alone. If there is a Windows recovery partition also installed, it can also be left alone as long as there are only two NTFS partitions total on the hard drive (i.e. there is no NTFS boot partition as well). If there are a total of 3 NTFS partitions on the hard drive, then the third Windows NTFS partition (the recovery partition) should be removed after creating Recovery CDs from it (see here).
  • one primary partition for the small boot partition (for storing a set of GRUB files)
  • an extended partition for the Linux OSs (should be the last partition on the hard drive)
  • In general I make:
  • my Windows partition 20 - 30 Gb -- filesystem type NTFS (or can even be FAT32) and with the boot flag checked
  • my "extra" partition 2 Gb -- which I tend to format as filesystem FAT32 (but can be anything, including ext3). If this is a Windows boot (or recovery) partition, it can be left unchanged.
  • my Grub partition 50 - 100 Mb -- formatted to filesystem type ext3
  • the extended partition is the remainder
  • At the end of the hard drive I usually leave a few Gb of free space (to allow for extra logical partition needs that I have not foreseen). This can't be done unless the extended partition is the last partition.
  • I then divide the extended partition into logical partitions:
  • a /swap logical partition that is 2 Gb -- filesystem type linux-swap
  • a logical partition for the / (root) folder of each planned OS (at least 10 Gb each, but 20-50 Gb is better) -- formatted as ext3 (or ext4 if you are planning to use a newer Linux OS)
  • optionally, a logical partition for each specific use, such as for a groupware partition (like Kolab, for example). I make this about 20 Gb and format it as ext3, since most specific uses (like Kolab) will be comfortable with ext3. Another example is creating a partition for the /home directory.

Note: If you are re-arranging (re-partitioning and re-formatting) your hard drive after already having a Grub bootloader installed, you will not be able to boot into Windows (or anything else) until you re-install Grub as part of a Linux OS re-installation. Panic not. Just proceed in a calm and orderly fashion.

Windows partitions

It is easiest if your Windows partition is the first one installed. This is because the Windows bootloader looks for Windows in the first partition. Also, Windows installers are unpredictable and can overwrite anything that is already installed on the hard drive.

If you have a brand new computer with no OS pre-installed, partitioning and OS installation is much easier. Create all your partitions before installing Windows. Make the first partition NTFS (or the less secure FAT32, if you wish), intending it for the Windows installation. Then divide the remainder of the hard drive (using GParted) using the partitioning scheme outlined above.

Generally, a retail "boxed" version of Windows (instead of an OEM or "backup" copy) installs quite happily to the first pre-configured, pre-sized partition. Go ahead and install it there, then skip on ahead to installing the Linux OSs.

However, OEM and "backup" copies of Windows often have installation peculiarities (including pre-configured spamware, spyware, and specific hardware configurations) that will want to use the entire hard drive. Oh well, if you must, you must.

After doing so, you will then have to shrink the partition down to approximately 20-30 Gb (or your desired size).

Changing Windows partition sizes

Using Shrink Volume on Vista and Windows 7

Make sure you heed the warnings that you should change the size of Windows Vista and Windows 7 partitions from within Windows only (using Settings -> Control Panel -> Administrative Tools -> Computer Management -> Storage -> Disk Management -> Shrink Volume), or using specific Windows tools made exclusively for this purpose.

Unlike Windows XP (and earlier Windows versions), Vista and Windows 7 does not allow you to move the MFT (Master File Table) that controls the NTFS file structure. Inexplicably, Microsoft locates this near the middle (or end) of the partition, somewhat limiting the ability to resize (shrink) the partition completely. You will be able to gain some hard drive from the "Shrink Volume" command (under Settings -> Control Panel -> Administrative Tools -> Computer Management -> Storage -> Disk Management), but not all of of the hard drive. I knew of no partition software that could move the MFT to a different place on the hard drive safely, but this tutorial suggested that Perfect Disk worked for this purpose. I therefore tried the trial version of Perfect Disk, and it seemed to work for me very nicely. I was able to shrink my Vista partition, using the steps in the tutorial (and Perfect Disk), from 300 Gb to 74 Gb. This was perfect for me.

You must then reboot those Windows OSs (once or twice) to allow them to adjust themselves to the partition size change (before using GParted for any other tasks). I have ruined several Windows installations by using GParted to resize the partitions for Windows Vista and Windows 7, or by forgetting to reboot Windows prior to using GParted. During these reboots, the Windows bootloader stores information about the changed partition size in its configuration file. If it doesn't have the chance to do this, the Windows bootloader will no longer work properly, and you will not be able to boot Windows.

Reinstalling Vista or Windows 7 on a new partition

A popular way to regain a significant amount of your hard drive with Vista/Windows 7 is to first re-format and re-partition the hard drive, and then re-install Vista/Windows 7 afterwards. When this works, you can reinstall Vista/Windows 7 in as little as 30 Gb.

Using Windows Recovery Disks

For a Windows re-installation, you will either need a retail version of Windows or a "Recovery" disk provided by your OEM (computer) manufacturer. The "Recovery" disk must allow Windows re-installation to a partition of any size. (Some recovery disks only allow re-installation to the entire hard drive).

My eMachines, Dell, and Toshiba Recovery disks, for example, allowed re-installation to any size partition, but my HP Recovery Disks did not. The HP Recovery Disk erased the entire hard drive (and all the data on it) and re-created a single Windows partition. All partitions (and the data in them) were destroyed in the process. (I therefore do not recommend using HP Recovery disks for this method. For HP computers with a Recovery Disk, use the shrink volume method outlined above, instead).

Physical Recovery Disks are not always shipped with a new computer. For example, my eMachines box instead provided a utility (eMachines -> eMachines Recovery Management) to create (burn) a pair of Recovery DVDs using data stored on an image in a recovery partition. If your OEM manufacturer gives you a similar option of burning Recovery disks (instead of supplying Recovery CD/DVDs with your computer), make sure you burn these disks prior to reformatting/repartitioning your hard drive. If your hard drive becomes corrupted during the re-partitioning process and you haven't created Recovery Disks, it will be too late.

Once the Recovery Disks are burned, it is no longer necessary to keep the recovery partition (and Windows can be re-installed without it).

As outlined in my partitioning scheme, I reserved the first primary partition for Windows. This can either be left as free space at the beginning of the drive (to be formatted as NTFS by the Windows installer later), or it can be formatted (by GParted, for example) as an NTFS partition with the boot flag set. I left 60 Gb for this first primary partition area (although 40 Gb is probably more than enough, since my Vista re-install occupied only 22 Gb). The Windows Recovery disk was able to re-install Windows no matter which method I used. Since this was really a "new" install, I didn't have to worry about the MFT table location problem, which was placed by the Windows installer within the new partition without any difficulty.

Obviously, to completely re-install an operating system if you have been using your computer a long time would entail an awful lot of work. You would have to back up all your data files first, re-install all your programs after re-installing the operating system, and then restore the data files you had backed up. I wouldn't want to do this on anything but a new computer.

Windows XP (or earlier)

You can use GParted to resize a Windows XP partition directly (without needing re-installation), but it is still best to reboot Windows XP twice after resizing its partition (before taking any other steps with GParted). Review this tutorial's section "Making Shrink Volume Work." Although Windows XP does not have a shrink volume utility, to resize the partition using GParted, these steps must be taken anyway. Specifically:

  • Use the Disk Cleanup Wizard to remove unnecessary files.
  • Uninstall "deadwood" programs and unneeded/unwanted Windows Components (using Control Panel -> Add/Remove programs).
  • Disable System Restore (Control Panel -> System -> System Restore -> Turn off System Restore on all drives)
  • Disable the page file (Control Panel -> System -> Advanced -> Performance:Settings -> Advanced -> Virtual memory:Change -> No paging file (ticked) -> Set)
  • Disable debugging (Control Panel -> System -> Advanced -> Startup and Recovery:Settings -> Write debugging information: (none) )
  • Disable Hibernation (Control panel -> Power Options -> Hibernate -> Enable hibernation (unticked) )

then reboot once (which will erase the C:\pagefile.sys file). Defragment the hard drive. Then log off Windows and start GParted. Now you will be able to shrink the XP partition.

  • After resizing the NTFS Windows partition, quit GParted and log into Windows again. Chkdsk will be run automatically and the computer will reboot. Login to a user account in Windows. It will prompt you to reinstall new hardware (the resized partition). Accept. Now turn back on the services turned off in the steps listed above, in reverse order. To be safe, log off Windows and log in one extra time. Now you are finished resizing the Windows XP partition and can proceed to other disk manipulations with GParted (or other activities such as installing (K)Ubuntu).

Windows bootloaders

The Windows bootloader stores information about how big the partitions on the hard drive are. If you change a partition size, Windows checks the new partition size at the very next reboot (using either chkdsk in XP or a new utility in Vista/Windows 7). It then writes that info to its bootloader configuration file. If you start mucking around with other partitions before it has a chance to record the changes and reset itself accordingly, the Windows bootloader will not be able to read the partition table properly (and will then refuse to boot entirely).

Since Grub boots Windows merely by chainloading the Windows bootloader, if the Windows bootloader doesn't work (i.e. doesn't recognize its own changed partition), then you are sunk.

If you ignore these warnings, I almost guarantee you will fry your Windows partitioning scheme and be unable to boot up Windows.

Install your first Linux OS

  • Install Ubuntu server -> (the usual pleasantries about language and mice and keyboards and stuff)

-> "Starting up the partitioner" -> Partition Disks: Manual

  • When you see the list of partitions, you will have to configure them manually.
  • You should note the small (50-100 Mb) boot partition that was previously created for use as the partition for the Grub chainloader files. In my example it is /dev/sda3. Make a note of what yours is named.
  • Configure the swap partition.
  • This shouldn't need configuring if you set it up properly with GParted.
  • You can make sure that Use as: swap area is set.
  • Configure the root partition for the OS. Choose one of your logical partitions, which in my scheme is #6, is ext3, and has about 30 Gb.
  • Use as: Ext3 journaling file system.
  • Format the partition: Yes, format it
  • Mount point: / - the root file system
  • Bootable flag: off
Note: You should write down which device this / (root) partition is on. You will need this information later for Grub settings. On mine, it is /dev/sda6.

-> Finish partitioning and write changes to disk -> "Installing the base system" -> ... ->

->"Install the Grub boot loader to the master boot record?": YES -> Continue

  • In this step, Grub must be installed both on the MBR (master boot record) as well as locally on the partition being installed (in this example /dev/sda6). The local version will be chainloaded by the MBR version. Therefore, install Grub a second time:

-> Go Back -> Install the Grub boot loader on a hard disk -> "Install the Grub boot loader to the master boot record?": NO -> Device for boot loader installation: /dev/sda6 -> Continue

Copy boot files to the small Grub partition

  • Boot into your newly-installed Ubuntu 9.04 OS. Open a command-line terminal (if you have installed a desktop).
  • Make a new directory and mount it in your new Ubuntu OS.
sudo mkdir /media/GRUBpartition
sudo mount /dev/sda3 -t ext3 /media/GRUBpartition
sudo mkdir /media/GRUBpartition/boot
sudo mkdir /media/GRUBpartition/boot/grub
Note: Use whatever the device name of your small Grub partition is (mine is /dev/sda3)
  • Make sure there are full read/write write permissions (this step may be optional).
sudo chmod 777 /media/GRUBpartition/boot/grub
  • Copy all your grub files to the new partition
sudo cp -r /boot/grub/* /media/GRUBpartition/boot/grub
  • Edit the menu.lst
sudo nano /media/GRUBpartition/boot/grub/menu.lst
  • Place a chainloader entry as the first entry:
## ## End Default Options ##
title  First (K)ubuntu OS (chainloader)
rootnoverify	(hd0,5)
chainloader	+1
title Second (K)ubuntu OS (chainloader)
rootnoverify   (hd0,6)
chainloader    +1

This assumes your first installed OS has its / (root) directory in /dev/hda6 (as in my example above). Grub Legacy counts the first partition as 0, so sda6 becomes (hd0,5), or hard drive 1 (it starts counting at zero), partition 6). If you want to chainload a bootloader on a second hard drive, partition 4 (/dev/sdb4), you would specify (hd1,3), instead, for example.

(I also put it an entry for my second planned OS, even though I haven't installed it yet. That will save me time later. For more examples, see this section.)

  • Return the permissions so that only root can change or execute the files:
sudo chmod 744 /media/GRUBpartition/boot/grub
sudo chmod 744 /media/GRUBpartition/boot/grub/*

Reinstall Grub to MBR

Now that the files are copied, we need to tell Grub Legacy to look for them there. Do this step from your Ubuntu 9.04 OS command-line terminal.

  • Start Grub Legacy:
sudo grub
grub> find /boot/grub/stage1

You should see the places there are grub configuration files.

(hd0,2)
(hd0,5)

Note that (hd0,2) corresponds to the small Grub partition (/dev/sda3), according to the counting method outline above. (hd0,5) corresponds to your first Linux OS (in the example /dev/sda6).

  • Make the small Grub partition the loadable Grub location.
grub> root (hd0,2)
grub> setup (hd0)
grub> quit

Install your second Linux OS

Again I'm going to use (K)ubuntu for the example, although any OS can now be installed.

  • Reboot into an Ubuntu LiveCD (I recommend a Server or Alternate edition, because some Desktop editions overwrite the Master Boot Record automatically, which is not at all desirable at this stage).
  • Install Ubuntu server -> (the usual pleasantries about language and mice and keyboards and stuff)

--> "Starting up the partitioner" -> Partition Disks: Manual

  • When you see the list of partitions, you will have to configure them manually.
  • Configure the swap partition.
  • This shouldn't need configuring if you set it up properly with GParted.
  • You can make sure that Use as: swap area is set.
  • Configure the root partition for the OS. Choose one of your logical partitions, which in my scheme is #7, is ext4, and has about 30 Gb.
  • Use as: Ext4 journaling file system.
  • Format the partition: Yes, format it
  • Mount point: / - the root file system
  • Bootable flag: off
Note: You should write down which device the / (root) partition is on. You will need this information later for Grub settings. On mine, it is /dev/sda7.

-> Finish partitioning and write changes to disk. (It is OK to format the swap and / (root) partitions.) -> "Installing the base system" -> ... ->

  • "Installing Grub boot loader" ->
  • "Install the Grub boot loader to the master boot record?": NO
  • "Install the Grub boot loader on a hard disk": /dev/sda7
Use whichever device that corresponds to your / (root) directory for this OS, of course.
This ensures that the Grub bootloader is installed to this OS's partition, as well.
  • Finish installation and reboot. This system ought to be selected as the Second Ubuntu OS, obviously.
  • Note: Once you have booted into this OS, you can now edit the chainloaded GRUB bootloader's local settings for this OS (at /boot/grub/menu.lst or /etc/default/grub) as usual, as you can for the first installed OS as well.

Changing main Grub boot menu settings

  • You can edit the local (chainloaded) Grub boot menu for each Linux OS that uses Grub Legacy (within the partition in which it is installed), if desired:
sudo nano /boot/grub/menu.lst
(kate can be used instead of nano as the text editor in Kubuntu, or gedit instead of nano in Ubuntu.)
  • You can edit the local (chainloaded) Grub boot menu for each Linux OS that uses Grub2 (within the partition in which it is installed), if desired (see these instructions):
sudo nano /etc/default/grub
sudo grub-mkconfig --output=/boot/grub/grub.cfg
  • To change the main Grub boot menu, you will have to change the menu.lst found on the small Grub boot partition.
  • If you are doing this from a Linux OS other than the first one you installed, again make a new directory for mounting:
sudo mkdir /media/GRUBpartition
  • Mount the directory
sudo mount /dev/sda3 -t ext3 /media/GRUBpartition
Note: Use whatever the device name of your small Grub partition is (mine is /dev/sda3)
  • Make sure there are full read/write write permissions (optional).
sudo chmod 777 /media/GRUBpartition/boot/grub/menu.lst
  • Edit the menu.lst
sudo nano /media/GRUBpartition/boot/grub/menu.lst
  • Edit or add new chainloader entries:
## ## End Default Options ##
title  First (K)ubuntu OS (chainloader)
rootnoverify	(hd0,5)
chainloader	+1
title Second (K)ubuntu OS (chainloader)
rootnoverify   (hd0,6)
chainloader    +1
title Newest Whizbang OS on second hard drive, partition 4 (chainloader)
rootnoverify   (hd1, 3)
chainloader    +1
Grub starts counting from 0, so the first hard drive is number 0 and the first partition is also number 0. sda6 (which is hard drive 1, partition 6) becomes (hd0,5). If you want to chainload a bootloader on a second hard drive, partition 4 (/dev/sdb4), you would specify (hd1,3).
  • For (K)Ubuntu 10.04 or later, the menu item for chainloading should be (if the OS is in /dev/sda7):
title Second (K)ubuntu OS (chainloader)
rootnoverify   (hd0,6)
kernel         /boot/grub/core.img
  • Return the permissions so that only root can change or execute the files (optional):
sudo chmod 744 /media/GRUBpartition/boot/grub/menu.lst

Using UUIDs for the main Grub bootloader menu

Although newer bootloader configurations specify partitions using their UUID designation (instead of using the (hd0,x) designation), this is problematic for the primary Grub bootloader. In current OS installation paradigms, when an operating system is re-installed within a partition, the UUID of that partition is simultaneously changed by the installer. If the primary Grub bootloader were to reference a partition by its UUID instead of by its position on the drive, (i.e. (hd0,x)), the primary Grub bootloader would no longer be able to find the partition whenever a new operating system was installed within it (and its UUID simultaneously changed).

For this reason, the primary Grub bootloader in the /boot partition should always use the rootnoverify (hd0,x) (instead of UUIDs) nomenclature to identify partitions.

Add MacOSX entry

You can add a chainloader entry for a MAC OS that you might have installed on its own partition (installed with its own bootloader on the partition). Here's the entry for a MAC that is on partition /dev/sda9 (equivalent to (hd0,8):

title Mac OS X
root (hd0,8)
makeactive
chainloader +1

Re-installing Grub Legacy after Windows upgrade or re-installation

Windows installations, re-installations, and upgrades rewrite the Master Boot Record so that it points to the Windows bootloader only (instead of to the copy of Grub in the boot partition). The Master Boot Record must therefore be re-written so that it will again point to the copy of Grub stored in your boot partition.

For this example, assume the boot partition is the /dev/sda3 partition (which is known as (hd0,2) to Grub Legacy).

You must use a version of a LiveCD that has Grub Legacy, i.e. Kubuntu/Ubuntu 9.04 (Jaunty) or earlier. Start the LiveCD and start a command-line terminal (Terminal in Ubuntu or Konsole in Kubuntu). From the command-line terminal start grub:

sudo grub

Then enter the commands to restore the Master Boot Record to point to the boot partition at /dev/sda3:

> root (hd0,2)
> setup (hd0)
> quit

Then reboot. Your previously created Grub bootup-menu options should again appear.

Other chainloader options

In Grub Legacy it is possible to specify the root of the partition to be chainloaded using a UUID instead of the hd(0,x) notation. If you do not know the UUID for the partition to be chainloaded, it can be discovered using:

sudo blkid

Replace the

root (hd0,6)

entry in the /boot/grub/menu.lst file (of the primary /boot partition)

with

uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx represents the actual UUID of the partition to be chainloaded.

  • Example:
Replace the lines (in the /boot/grub/menu.lst file)
root (hd0,9)
chainloader +1
with the lines
uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
chainloader +1

This method works no matter which operating system is to be chainloaded. It will not work, however, for the operating system stored in (hd0,9) due to a quirk (see below).

Will it work for bootable devices (such as USB flashdrives) that have a UUID? I don't know -- I haven't tried it yet!

  • This next method will only work when the operating system in the chainloaded partition uses Grub Legacy (and has a local /boot/grub/menu.lst stored within the partition):
Replace the lines (in /boot/grub/menu.lst)
root (hd0,9)
configfile /boot/grub/menu.lst
with the lines
uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
configfile /boot/grub/menu.lst

Chainloading Grub2 from Grub Legacy

  • Grub2 is erratic. I no longer chainload it. Instead, it is possible to bypass Grub2 entirely and load an OS directly using Grub Legacy (stored in a boot partition, for example) using an entry in menu.lst of the format:
title Kubuntu Oneiric OS (chainloader)
rootnoverify (hd0,6)
kernel /vmlinuz root=/dev/sda7 ro
initrd /initrd.img
  • My old method for chainloading Grub2 (installed in this example in the /dev/sda7 partition) from Grub Legacy used an entry in the Grub Legacy configuration file (/boot/grub/menu.lst, stored in the standalone boot partition with the Grub Legacy files) with this format:
title (K)Ubuntu Oneiric OS (chainloader)
rootnoverify (hd0,6)
kernel /boot/grub/core.img

The (hd0,9) problem

Grub Legacy has a quirk -- it does not like to chainload (hd0,9) using the command chainloader +1. (Something about 9 + 1 = 10 requiring an extra digit, or something.)

Most people don't have more than 2 or 3 operating systems on their computer so it is usually not an issue. Here at Ubuntuguide, however, we chainload as many as 10 different OS on every machine (not including virtual machines).

If the operating system in a chainloaded partition happens to use Grub Legacy (and therefore uses /boot/grub/menu.lst locally), the alternative to

chainloader +1

is to use the command

configfile (hd0,9)/boot/grub/menu.lst

(This can be used for any partition in which the chainloaded operating system uses Grub Legacy, not just (hd0,9). It will not work, however, if the chainloaded operating system uses Grub2.)

This can alternatively be specified as

rootnoverify (hd0,9)
/boot/grub/menu.lst
  • It is also possible to chainload by specifying the UUID for the chainloaded partition (hd0,9):
uuid xxxxx-xxxx-xxxx-xxxx-xxxxx
/boot/grub/menu.lst

Of course, you must find out the UUID for (hd0,9) first:

sudo blkid

Protecting Grub Legacy from cracking

Manipulating partitions on the hard drive

Most users that have multiple operating systems eventually choose to delete, resize, or re-arrange the partitions containing the operating systems. This can become an anxiety-producing task especially when it comes to ensuring subsequent bootup capabilities.

For techniques to accomplish this successfully (for systems that have been configured according to the guidelines above), see:

Manipulating Partitions

Most users that have multiple operating systems eventually choose to delete, resize, or re-arrange the partitions containing the operating systems. This can become an anxiety-producing task especially when it comes to ensuring subsequent bootup capabilities.

Use the (K)Ubuntu Desktop LiveCD

There are several tools that are required to accomplish partition-manipulation tasks, including GParted, KDE Partition Manager from newer versions of the Kubuntu LiveCD, and several Linux commands accomplished from within a Linux command-line terminal. The SystemRescueCD (which has been a preferred tool for many years) has all the required tools (and more), but uses as its operating system Gentoo Linux instead of Ubuntu Linux (so it may be less familiar to many (K)Ubuntu users). The Ubuntu Desktop LiveCD (32-bit regular version, Lucid 10.04LTS or later) can be used instead of SystemRescueCD for most hard disk manipulation tasks, and already has GParted included on it. (Kubuntu LiveCDs, Natty 11.04 or later, have KDE Partition Manager, which works almost identically to GParted.)

  • Download and burn onto CD/DVD a copy of the Ubuntu Desktop LiveCD (32-bit regular version, Lucid 10.04LTS or later) or Kubuntu Desktop LiveCD (Natty 11.04 or later).
  • Boot into the (K)Ubuntu Desktop LiveCD and start it with the "Try (K)Ubuntu" option (not the "Install" option).

Use GParted to manage partitions

(Note: These instructions can be accomplished in a similar fashion using the KDE Partition Manager from newer versions of the Kubuntu LiveCD as well.)

  • Start GParted from the Ubuntu Desktop LiveCD:
Menu -> System -> Administration -> GParted
  • A graphical display of all the partitions on your hard disk will be shown. If you have two hard disks on your system, they generally are referenced as /dev/sda and /dev/sdb (or sometimes /dev/hda and /dev/hdb). GParted works with only one hard disk at a time. To select which hard disk to work with, choose:
GParted menu -> Devices
  • Working with GParted is relatively intuitive. However, it is very easy to irreparably damage your system by undertaking changes without a thorough knowledge of partitions. It is highly recommended to read this article about multiple operating systems for an overview. Specifically heed the warnings about using GParted to change any NTFS partition on which a Windows OS systems resides. Windows has quirks and peculiarities about its OS partition that is better managed with Windows-specific tools. (NTFS partitions that do not have a Windows OS on them, however, can be managed with GParted.)
  • It is especially important to recognize that deleting or adding a partition will change the partition numbering scheme (and other partition characteristics) on the hard drive. This is the major consideration in reorganizing your hard drive. Bootloaders find and load operating systems based on their partition location, specified by the partition number on the disk or by a UUID associated with the partition, both of which can change when creating, changing, or deleting partitions.
  • GParted only allows changes to partitions that are subsequent to any locked partitions on a hard drive (locked partitions are designated in GParted with a key icon.) For this reason, it is best to have any partitions that are rarely likely to change and/or likely to be locked (e.g. boot partitions, the linux-swap partition, and Windows partitions that won't be manipulated) closer to the beginning of the hard drive and to locate Linux partitions that will be manipulated the most towards the end of the hard drive.
  • In general, the least problems occur when a test or temporary partition is the last one on the hard drive. Adding, deleting, or changing the last partition on a hard disk does not affect any of the preceding partitions, so it is the least troublesome. Whenever possible, relegate a temporary or test partition (and its operating system) to be the last partition of the hard drive.
  • Write down the details of all the partitions displayed in GParted on some scratch paper, and note any changes that are made by GParted as they are made. In specific, when GParted changes the designation of a partition (from /dev/sda8 to /dev/sda7, for example), note this carefully, as this information becomes critical later in changing bootloader settings.

One linux-swap partition per computer

  • Only one linux-swap partition is required for computers that will run only one operating system at a time. (This does not apply to the special case of virtual machines, but virtual machines do not use conventional partitions anyway. Virtual machines are not viewed by a computer as independent operating systems but instead are viewed as applications running within the primary operating system). If already present on a hard drive, the linux-swap partition is used by the Ubuntu LiveCD and therefore locked in GParted. If changes need to be made to the linux-swap partition itself, therefore, use the GParted LiveCD or SystemRescueCD instead of the Ubuntu LiveCD (and run GParted from one of them).
  • When installing, updating, re-arranging, or otherwise any Linux operating system, it is not necessary to alter the linux-swap partition in any way. The linux-swap partition is used by all Linux operating systems and is not peculiar to any Linux distribution. There is no need to recreate it, reformat it, nor change it in any way (except perhaps its size, which is ideally 2 Gb).

Creating and "moving" free space

There are two places free space ("unallocated space") can exist: within the extended partition (assuming that one exists) and on the hard disk outside the extended partition. Moving the free space so that it is inside or outside the extended partition is a skill that must be mastered in order to successfully manage partitions.

  • When free space exists outside the extended partition, it can be used to create or increase the size of any primary partition or the extended partition itself.
  • When free space exists within the extended partition, it can be used to create or increase the size of any logical partition within the extended partition.

In addition, the position of free space determines how it can be used. Free space can only be added to an existing partition if it is next to ("touching") that partition.

Free space can not itself be moved, however. Only partitions can be moved. "Moving free space" really means that partitions themselves must be moved in such a way that the free space "ends up" being in the desired location.

  • Free space can only be created by deleting or shrinking an existing partition. This is the critical decision in manipulating partitions. Which partition can be shrunk or deleted safely? (Again, be very careful not to shrink any partition with a Windows OS on it using Gparted.)

Creating or resizing a partition

GParted can create many types of partitions, including ext4, ext3, NTFS, and FAT32, which is the majority of partition types that most users will create. It can resize any of these types of partitions as well. However, resizing an NTFS partition that contains a Windows OS within it may cause problems with the Windows OS itself. (All NTFS and FAT32 partitions should also be defragmented before resizing.)

  • The most important decision will be whether a new partition will be a primary partition (to be used for a Windows operating system, for a Windows boot partition, or for a Grub Legacy boot partition), an extended partition (of which there can only be one per hard drive), or a logical partition that resides within a pre-existing extended partition. All Linux partitions can be in logical partitions.
  • To create or increase the size of a logical partition within the extended partition, the extended partition itself must already be big enough to accommodate the new logical partition or its new size. To increase the size of the extended partition itself, there must be free space available outside the extended partition and contiguous to it ("touching" it). This requires manipulating the exsting partitions (by moving them and/or shrinking them) until the free space is in the necessary position. Once the free space is contiguous with (and outside) the extended partition, the size of the extended partition can be increased. This will have the effect of moving the free space into the extended partition.
  • Once the free space is within the extended partition, it can be used to create or increase the size of a logical partition. To increase the size of a logical partition, the free space must be contiguous to (i.e. "touching") that logical partition by rearranging the positions of the existing logical partitions within the extended partition.

Changing Grub Legacy in a boot partition

When partitions have been moved, added, or deleted, the position and designation of all partitions on a hard drive may change. For example, if the /dev/sda7 partition is deleted, a partition that previously was designated as /dev/sda8 will now become /dev/sda7.

Grub Legacy (sometimes used in a freestanding boot partition) often boots operating systems by referring to the partition (in which the OS is located) by its position on the hard drive. In Grub Legacy, the position /dev/sda7 is referred to as (hd0,6), for example, and /dev/sdb2 is referred to as (hd1,1).

After manipulating partitions on a hard disk, therefore, the main Grub Legacy menu.lst (that resides on the boot partition) needs to be edited. This can be done by starting a command-line terminal from the Ubuntu LiveCD:

Menu -> Applications -> Accessories -> Terminal

Then follow the instructions here.

Changing Grub2 in a changed partition

Note: This section is being edited.

The hardest thing to do is to change Grub or Grub Legacy that exists within a partition that has been changed or moved. If that partition uses Grub2, then the Grub2 bootloader within that partition can be reconstructed using the Ubuntu LiveCD and then stored within that partition once again.

For example, if a (K)Ubuntu operating system (Karmic 9.10 or later) has been moved from /dev/sda8 and now resides at /dev/sda7, Grub2 can be reinstalled on that partition for the (K)Ubuntu operating system there using the Ubuntu LiveCD. Open the command-line terminal from the Ubuntu LiveCD:

Menu -> Applications -> Accessories -> Terminal

and use the command:

sudo grub-install /dev/sda7

Booting (K)Ubuntu manually from Grub Legacy

When a partition has been changed whose operating system contains a Grub2 bootloader, the Grub2 bootloader might no longer function. If, however, a Grub Legacy bootloader has been previously installed in its own boot partition on the system (as is recommended here), the Grub Legacy bootloader can be used to manually boot the operating system. (Once the operating system has been manually booted, Grub2 can then be reconstructed from within the running OS.)

  • Reboot the computer without using the Ubuntu LiveCD. When the Grub Legacy menu appears, enter the Grub Legacy command line (using the command c ):

In newer versions of (K)Ubuntu there are symbolic links to the current kernel files, so the following commands can be entered at the grub prompt (the example assumes the OS is in the partition at /dev/sda7):

grub> root (hd0,6)
grub> kernel /vmlinuz root=/dev/sda7 ro
grub> initrd /initrd.img
grub> boot

In newer versions of (K)Ubuntu, the following commands can also be used (if the core.img has not been changed during updates):

grub> root (hd0,6)
grub> kernel /boot/grub/core.img
grub> boot
  • Once the OS has successfully booted, the Grub2 bootloader within it can be reconstructed using the instructions here.

Discovering the current kernel files manually

In older versions of (K)Ubuntu, symbolic links were not included to the current kernel files. For those versions, the kernel files must be discovered and then entered into the Grub Legacy command line manually.

  • Discover the current kernel used by the OS. Using the Ubuntu LiveCD, open a command-line Terminal:
Menu -> Applications -> Accessories -> Terminal

If the designation of the partition is currently /dev/sda7, create a mount point for the partition. Use ext4 if the partition uses an ext4 filesystem or ext3 if it uses an ext3 filesystem. If you are unsure about the partition's filesystem type or designation, use GParted from the Ubuntu LiveCD to find out.

sudo mkdir /media/sda7
sudo mount -t ext4 /dev/sda7 /media/sda7
cd /media/sda7/boot
ls

Write down the most recent vmlinuz and initrd files listed there. As an example, the latest files may be vmlinuz-2.6.32-21-generic and initrd.img-2.6.32-21-generic

  • Reboot the system and at the Grub Legacy menu, enter the Grub Legacy command line (using the command c ). then enter the commands at the grub prompt:
grub> root (hd0,6)
grub> kernel /boot/vmlinuz-2.6.32-21-generic root=/dev/sda7 ro
grub> initrd /boot/initrd.img-2.6.32-21-generic
grub> boot
  • Once the operating system has successfully booted, Grub2 can be reconfigured using the instructions here.

Changing Grub Legacy in a changed partition

Generally, only versions of (K)Ubuntu prior to Karmic use Grub Legacy by default. (Only Hardy and Dapper are still supported.) The local Grub Legacy menu.lst of one of these versions must be edited manually, using the instructions here.


Virtualbox in Windows

Virtualbox (by Sun) has some advantages and disadvantages. There is a free proprietary edition as well as a subscription-based enterprise edition. The free edition only allows usage of a 32-bit operating system (as the guest OS) whereas the subscription edition allows a 64-bit guest OS. (Both require registration.) There is also has a free open source edition, but this is not easy to install in Windows (unlike in Linux). Virtualbox is available for all operating system platforms, and therefore a virtual machine created in one operating system (Windows, Apple, Linux) can be used in another. Furthermore, it is possible to convert virtual machines created in Virtualbox to VMWare and vice versa.

I find both the installation process and the interface for Virtualbox quite user friendly (as I do VMWare). So far I have had few difficulties with Virtualbox and recommend it.

Install Virtualbox in Windows

  • Obtain and download a copy of the Virtualbox (binary) installer for your (Windows) operating system here.
  • Install the program, following the prompts.
  • Start Virtualbox
Start menu -> Programs -> Sun Virtualbox -> Virtualbox

(Optional: Of course, if you would like Virtualbox to start every time you run Windows, you can copy the Virtualbox shortcut into the Start menu -> Programs -> Startup folder.)

  • Create a new virtual machine:
Virtualbox -> New -> Next ->
Name: UbuntuVirtualServer
Operating System: Linux
Version: Ubuntu
-> Next -> Memory: Base memory size: 1024 Mb
Note: Use the amount of RAM for the virtual machine that you can afford. Linux requires less memory to run than does Windows, but the amount of RAM that you dedicate to the virtual machine in this step will not be available to the Windows host. On my laptop, I have 3 Gb RAM, so I dedicate 1024 Mb (1 Gb) to the virtual machine in this step and leave 2 Gb for Windows. You should always leave at least 1 Gb RAM for Windows (or it will run painfully slowly). Linux is able to run with only 512 Mb in server mode or 1 Gb in desktop mode (perhaps even less).
-> Next -> Virtual Hard Disk ->
Boot Hard Disk (Primary Master): (ticked)
Create new hard disk: (ticked)
-> Next -> Next -> Hard disk storage type:Dynamically expanding storage: (ticked)
-> Next -> Virtual Disk Location and Size:
Location: UbuntuVirtualServer
Size: 8.00 GB

Note: Use whatever size you can afford in Windows. This will take space from your hard drive (so make sure it is available to begin with). A Linux server can easily run in 8 GB, but if you plan to run a GUI desktop in addition (the Ubuntu desktop or Kubuntu desktop, for example), you should consider making this between 10 -20 GB. However, because you have chosen the dynamically expanding storage in the preceding step, the virtual machine will automatically expand storage later if you guess wrong here. (I usually just accept 8 GB.)

-> Finish.

Now you will have a new virtual machine. You can create multiple virtual machines, in this fashion. If you desire, you can run each new virtual machine simultaneously (if you have enough RAM and hard drive resources).

Install Ubuntu edition for virtual machines

There is a version of the Ubuntu server that is optimised for usage within a virtual machine. It is provided on the Ubuntu Server edition LiveCD. The LiveCD image (.iso) found here can be downloaded onto your hard drive. It can then be installed directly into your virtual machine from the hard drive. Alternatively, you can also burn the .iso image onto a CD and install Ubuntu Server into the virtual machine from the CD. Both methods work identically during the Ubuntu Server installation process.

The free version of Virtualbox only allows the use of a 32-bit operating system as a guest OS, so you should download the 32-bit Ubuntu server (.iso) image.

  • Start the virtual machine you created in the previous step.
Virtualbox -> Ubuntu Virtual Server (highlighted) -> Start
The "First Run Wizard" will prompt for the location of the installation disk -> Next ->
CD/DVD-ROM device (ticked) ->
Media Source:
  • select the CD-ROM drive (if you burned the LiveCD (.iso) image onto a physical CD), or
  • browse for the folder where you stored the (.iso) image onto your hard drive (if you did not burn it to a physical CD)
-> Next ->
  • Install Ubuntu server virtual machine edition:

The First Run Wizard will automatically start the LiveCD from the location you indicated, and you will see the Ubuntu Server LiveCD screen.

  • Choose language: English ->
  • Important: note this step carefully! Select the minimal virtual machine installation mode:
* Click the F4 (modes) key -> Install a minimal virtual machine ->
  • Install Ubuntu Server
  • Select your installation options. When asked about partitioning, use the guided partitioning method and use the entire disk. This uses the entire virtual machine disk (which is 8 GB or whatever size you created when creating the virtual machine), not the entire physical hard drive disk.
  • Finish the remainder of the Ubuntu server installation. At the conclusion the Ubuntu system will automatically reboot within the virtual machine. When it restarts, you will then have a fully function Ubuntu Server within the virtual machine. Immediately update the operating system:
sudo apt-get update
sudo apt-get upgrade

Install a desktop

This is a decision that is difficult to make. Having an Ubuntu or Kubuntu GUI desktop is nice, but it also slows down the virtual machine server considerably and takes a large chunk of the 8.00 GB virtual disk (which may need to be dynamically expanded and thereby occupy more space on your hard-drive).

If you intend to use many of the features of Ubuntu or Kubuntu, this is worthwhile. Install a desktop:

sudo apt-get install ubuntu-desktop
or
sudo apt-get install kubuntu-desktop
  • After all the packages are installed, restart the OS within the virtual machine and you should now boot into the GUI desktop.

Install Linux Guest Additions

If you have installed a (K)ubuntu desktop, you will definitely need this for functionality. There are quirks. A general introduction is found at the VirtualBox Manual. The Guest Additions are contained within the VBoxGuestAdditions.iso CD image file contained within the VirtualBox installation folder (on my Windows system it is in the C:\Program Files\Sun\VirtualBox folder). (If there are errors using this file, it must be copied to a neutral location (such the Documents folder) and used from there.)

  • Mount the VBoxGuestAdditions.iso as a virtual CD-ROM device (for the virtual machine you have created in the preceding steps). (The virtual machine must be stopped while doing this).
VirtualBox -> Machine -> Settings -> Storage
-> Add CD/DVD Device (CD icon with green + sign) -> Attributes -> CD/DVD Device: VBoxGuestAdditions.iso
  • Start the virtual machine.
  • From a command-line terminal (Terminal in Ubuntu or Konsole in Kubuntu), change to the CD-ROM/DVD directory:
cd /media/cdrom0
  • Install prerequisites:
sudo apt-get install dkms
  • Run the Guest Additions binary:
sudo ./VBoxGuestAdditions-Linux-x86.run

(If you are using a 64-bit edition of Ubuntu as a guest OS, see the VirtualBox Manual for additional instructions. Because this is not an option with free versions of VirtualBox, I will not discuss it here).

  • Once the installation is complete, you can unmount the VBoxGuestAdditions.iso as a virtual CD. (The virtual machine must be stopped while doing this).
VirtualBox -> Machine -> Settings -> Storage -> Storage Tree
-> VBoxGuestAdditions.iso -> Removes the attachment highlighted in the Storage Tree (CD icon with green - sign) -> Remove

Creating shared folders

This is a folder on your Windows host that will be shared with the Ubuntu virtual machine. An extremely nice feature. The GuestAdditions must be installed to use this feature. See the VirtualBox manual on Shared folders for more information.

  • With the virtual machine stopped, designate a shared folder. In my example I use a folder in Windows that is already commonly shared (C:\Users\Public\Documents).
VirtualBox -> Machine -> Settings -> General -> Shared Folders
-> Add Shared Folders (Ins) (Folder icon with a + symbol)
-> Folder Path: Other -> C:\Users\Public\Documents
-> Folder Name: PublicDocuments
  • Start the virtual machine.
  • Create a folder that will be associated with the shared Windows folder:
sudo mkdir /media/windows-shared
  • Test that the Windows shared folder can be mounted:
sudo mount -t vboxsf PublicDocuments /media/windows-shared
  • If there are no errors, then ensure the shared folder is mounted at every bootup of the virtual machine. Edit the /etc/fstab file:
sudo nano /etc/fstab

(you can used gedit in Ubuntu or kate in Kubuntu instead of nano, if you'd like).

  • Add the line:
PublicDocuments /media/windows-shared vboxsf defaults 0 0
  • Reboot the virtual machine (sudo reboot).
  • Access /media/windows-shared just like any other folder (from Nautilus or Dolphin, for example) within the virtual machine.
  • Access C:\Users\Public\Documents just like any other folder in the Windows host.

Android emulation

Android-x86 in VirtualBox

The Android-x86 emulator is fast and efficient. It runs many apps (but not as many as the Android SDK emulator).

  • In Virtualbox (or QEMU, VMWare, or other virtual environment), install Android-x86 using the .iso downloaded to a hard drive (or, alternatively, burned to a CD or USB drive). Details:
  • From your favorite package manager (Muon, Synaptic, etc.) you can install the package virtualbox-qt, or from the command line:
sudo apt-get install virtualbox-qt

Both the proprietary binary for VirtualBox and the necessary dependency virtualbox-dkms will be installed at the same time.

  • Download a version of the Android-x86 image (.iso) from here. I used the latest version for ASUS (eee) Netbooks.
  • Start VirtualBox:
Menu -> Utilities -> VirtualBox
  • Create a new Virtual Machine for the Android x-86 OS:
VirtualBox -> New -> Next -> Name: Android -> OS Type: Operating System: Linux -> Version: Linux 2.6
-> Next -> Base Memory Size: 512 MB -> Next -> Virtual hard disk: Create new hard disk -> Next
-> File type: VDI -> Next -> Storage details: Dynamically allocated -> Next -> Location: Android
-> Size: 8 GB -> Summary: Create

Note: The Android 2.2 and 2.3 versions run very efficiently with only 256 MB Base Memory and require little hard disk space. For these versions I used only 2 GB for a virtual disk, of which 1 GB is used for the virtual ("fake") SDcard.

  • Tweak the VirtualBox Settings so that mouse capture is enabled for the newly created Android virtual machine. (Without this step you will not be able to use the mouse (or touchpad) in Android.):
Virtualbox -> Settings -> System -> Enable absolute pointing device (unticked)
  • The Android-x86 website says that only Soundblaster 16 works as a VirtualBox soundcard for Android, so change the Audio settings for VirtualBox:
VirtualBox -> Settings -> Audio -> Audio controller: Soundblaster 16
  • I use a wired Ethernet connection (with Android-x86 2.3). I therefore tweak the VirtualBox Settings to emulate a virtual PCnet-Fast III adapter, as recommended on the Android-x86 website.
VirtualBox -> Settings -> Network -> Enable Network Adapter (ticked) -> Attached to: NAT
-> Advanced -> Adapter Type: PCnet-Fast III (Am79C973) -> Ok
It is also possible to use the Attached to: Bridged Adapter mode with Name: eth0
  • Choose the downloaded Android-x86 (.iso) as a virtual CD-ROM to be used by VirtualBox:
VirtualBox -> Settings -> Storage -> Storage Tree: CD icon (Empty)
-> CD icon: Choose a virtual CD/DVD disk file ...
-> (click on the name of the downloaded android-x86-4.0-eeepc.iso file) -> Ok
  • Start the installation of Android-x86 in the VirtualBox virtual machine:
VirtualBox -> Start --> Installation -- Install Android-x86 to hard disk
-> Choose Partition: Create/Modify partitions -> Ok -> New -> Primary -> Size (in MB): 8588
-> Bootable -> Write -> Are you sure you want to write the partition table to disk? (yes or no): yes -> <Enter>
-> Quit -> Please select a partition to install Android-x86: sda1 LINUX VBOX HARDDISK -> OK ->
-> Choose filesystem: ext3 -> OK -> Are you sure to format the partition sda1? -> Yes
-> Do you want to install bootloader GRUB? -> Yes -> Do you want to install /system as read-write? yes

Note: the partition in this step is not on your physical hard drive but is entirely within the virtual hard drive created in the previous step. You will not erase anything on your physical hard drive during this step; only the contents within the virtual hard drive are at stake (and to your physical hard drive, the virtual hard drive appears only as an 8 GB file). There is no danger of harming your hard drive no matter what you do here! During installation of the Android OS, it makes sense to use the entire space of the newly created virtual hard drive (8 GB if following the instructions outlined above) for the Android OS.

  • After installation completes, the "Congratulations! Android-x386 is installed successfully" message appears.
  • At this stage I like to optionally Create a Fake SDcard (although there are several other options for SDcard emulation).
-> Create a fake SD card -> Please input the size of the sdcard.img in MB: 1024 -> Creating sdcard.img -> The fake SD card is created successfully.

I use half of the total partition space for my fake SDcard.img, so that if I created a 2 GB partition, I create a 1 GB fake SDcard.img. As long as plenty of space remains in the partition for the Android-x86 OS (I generally leave 1 GB for the OS), however, the size of the sdcard.img is unimportant and can be as large or small as desired.

  • After completing the initial Android setup (but before a "Reboot"), shutdown the Android virtual machine and tweak the VirtualBox settings so that the virtual CD-ROM no longer uses the Android-x86.iso virtual CD. (If you don't do this the virtual CD will be loaded again at reboot.):
VirtualBox -> Machine -> Close -> Power off the machine
-> Settings -> Storage -> CD-ROM icon (click) -> Host Drive DVD RW (select your physical CD/DVD drive, which should be listed) -> Passthrough ('ticked') -> OK
  • Restart the virtual machine and this time it should boot to the newly created virtual hard drive (with the newly installed Android-x86 OS on it). Whenever you Start the Android virtual machine in the future, it should boot straight into Android-x86.
  • During the first run, you can use the TAB button to navigate between options, or by clicking on the Android virtual machine window, you can "capture" the mouse (a blue pointer should appear) for use by the Android virtual machine. To return to the (K)Ubuntu normal (white) mouse pointer, use the <RIGHT-CTRL> button.
-> Start -> (setup initial options as desired)

Networking for Android-x86

  • By default the Android OS uses wireless networking. This can be linked to the (K)Ubuntu host's wireless adapter using either the NAT or Bridged networking modes of VirtualBox.
  • The Android 2.2 and 2.3 versions of Android-x86 also include wired Ethernet networking capabilities, which works well. Because I use Android-x86 in a wired environment, I mostly use Android-x86 2.3.
  • If your (K)Ubuntu host only has a wired ethernet connection, then you will use the eth0 connection within Android. In the VirtualBox Networking settings (Virtualbox -> Settings -> Network -> Attached to:) you can use NAT or Bridged Adapter (eth0) but if you intend to use any server functions from Android, you must use the Bridged Adapter (eth0). Start the Android virtual machine after choosing the VirtualBox settings.
Wired networking for Android-x86 RC 4.0RC1
  • (Note: I could not get wired networking to function properly in the Android-x86 3.2 version.)
  • These instructions were tested using the android-x86-4.0-RC1-eeepc version of Android-x86 and were adapted from those given here.
  • Make sure the host computer's firewall is off while testing connections.
  • Once the Android system has fully booted within the virtual machine, go to the root command-line using <ALT-F1>.
  • The command line can also be reached through the Terminal Emulator:
Android -> Home icon -> App menu icon -> Terminal Emulator
You may then need to become the superuser from the command-line: su
  • (This step may be optional and is suggested only if needed for troubleshooting. It is necessary if using the "route add" command in the next step.) From the command line, enable the wired networking port using ifconfig. Use an unused IP address on the main LAN:
ifconfig eth0 192.168.0.59
  • (This step may be optional and is suggested only if needed for troubleshooting.) For the eth0 connection set a route to the default gateway (this should be the IP address of your router / DHCP server on your LAN):
route add default gw 192.168.0.1 dev eth0
  • For some reason, my connection would not work unless a DHCP connection is enabled:
netcfg eth0 dhcp
  • Test to make sure traffic is reaching the router:
ping 192.168.0.1
  • Set a DNS provider (examples are 8.8.8.8 for Google, 8.26.56.26 for Comodo, and 206.67.222.222 for OpenDNS).
setprop net.dns1 8.8.8.8
  • Return to the Android environment using <ALT-F7>.
  • Following these steps, start the Browser. If you get a webpage, then the connection works. If not, make sure all firewalls are off (for your VirtualBox host) while testing your setup.

Installing apps

  • Use either the Android 2.2 or Android 2.3 version of Android-x86 for wired networking. Most (but not all) apps will work with wired connections.
  • The following apps work (both wirelessly and with wired connections):
  • These apps do not work:
  • Netflix (stock app from Amazon Appstore or the modified XDA-developers' version). The Netflix app requires Android version 2.3 or later, in general, but I have not been able to get Netflix to work with any Android-x86 version yet.

Modified apps

Note: These are for testing only.

For the Android-x86 4.0RC1 version with an imperfect wired connection, I needed to download from the command-line:

  • Go to the command line using <ALT-F1>.
  • Change to the /sdcard directory and download the app using wget:
cd /sdcard
wget http://ubuntuguide.org/images/Amazon_Appstore-release.apk
  • Return to the Android GUI environment (<ALT-F7>). Use the OpenManager file browser to navigate to the /sdcard directory, where the downloaded xxx.apk file should be found. Click on it to install it.
  • In other versions with working wired or wireless connections (i.e. Android 2.2 and 2.3), the apps can be downloaded directly from the Android Browser.

Usage tips

  • In Android-x86 2.2 and 2.3, the "Back" function is the right mouse button or "ESC." To go to the "Home" screen, use the "Windows" button of the keyboard. A quick <double-click> with the captured mouse will alternately zoom in and zoom out (for many apps). The <PGUP>, <PGDN>, and arrow keys of the physical keyboard can be used to navigate the Android-x86 display.
  • To disable the pop-up Android keyboard, untick the "Android keyboard" in the Android -> Settings -> Language & keyboard settings.
  • If you have created a VirtualBox virtual machine for your Android OS entitled Android, then it can be started using the command (which can be placed in a menu item):
VirtualBox -startvm "Android"
  • You can also start VirtualBox in fullscreen mode:
VirtualBox -fullscreen -startvm "Android"
However, for this to be beneficial, you would also have to change the display settings of the Android-x86 OS to be larger as well. For example, if using a 1024x768 screen, the UVESA_MODE=1024x768 option should be added to the Grub bootup settings. This can be done by editing the Grub settings using the vi editor. Boot Android-x86 into the "Debug mode" to enter the command-line environment, then edit /mnt/grub/menu.lst:
vi /mnt/grub/menu.lst
and add UVESA_MODE=1024x768 to an existing line or create an entirely new entry that includes the option. In vi use the i option to start inserting text and ESC to stop. Save and quit the vi editor using :wq. Reboot the Android system for the changes to appear.
  • Portrait mode can be enabled by creating custom video modes for VirtualBox. Using the instructions here I create four custom video modes for the four portrait resolutions that I like: 320x480 (a size that approximates a smartphone size), 540x720 (which works well for me in fullscreen mode on my 1024x768 monitor), 504x672 (which works well for me in windowed mode on my monitor), and 450x600 (which is easily maneuvered in window mode). These modes are all 16-bit modes (24-bit modes don't work for me in these sizes). (As in the other examples, my virtual machine is named Android.)
VBoxManage setextradata "Android" "CustomVideoMode1" "320x480x16"
VBoxManage setextradata "Android" "CustomVideoMode2" "540x720x16"
VBoxManage setextradata "Android" "CustomVideoMode3" "504x672x16"
VBoxManage setextradata "Android" "CustomVideoMode4" "450x600x16"
I then edit the Android Grub menu (as above) and add entries for my custom resolutions, using UVESA_MODE=320x480 DPI=160, UVESA_MODE=540x720 DPI=160, UVESA_MODE=504x672 DPI=160, and UVESA_MODE=450x600 DPI=160, each in a different Grub entry, to correspond to the custom video modes I created. When I start the Android virtual machine I can select my resolution and orientation by choosing from one of these newly created Grub menu entries. (Note that by setting a 16-bit resolution for the CustomVideoModes, the Android-x86 Grub settings must correspondingly be DPI=160 instead of DPI=240.)
  • An easy method to change the display size of Android-x86 is the "Scale" mode of VirtualBox. In this mode, the size of Android-x86 will be scaled to whatever size the VirtualBox window is stretched. It is a menu item in VirtualBox, or can be reached from the hotkeys: <RIGHT-CTRL>-<HOME>.

Android SDK emulator

Android SDK for Linux is a 32-bit Android emulator/software development kit. It incorporates a QEMU virtual machine framework as part of its installation. It provides a fully functional Android environment and apps can be installed from (and run within) the emulator. However, it is a very top-heavy and slow environment to use for emulation unless you have a very powerful computer with lots of RAM and processing power.

  • Install the pre-requisites:
sudo apt-get install ia32-libs default-jre

Note: ia32-libs is only needed on a 64-bit system. default-jre will also install open-jdk6-jre.

  • Download the Android SDK (e.g. android-skd_r18-linux.tgz from here and extract it (using Ark, for example) to its default folder ~/android-sdk-linux/ (i.e. /home/user/android-sdk-linux/):
wget http://dl.google.com/android/android-sdk_r18-linux.tgz
tar xvf android-sdk_r18-linux.tgz
  • Add the /home/user/android-sdk-linux/tools and /home/user/android-sdk-linux/platform-tools/ directories to the PATH for the user (or for the system) by editing /home/user/.profile (or /etc/profile for system-wide use):
sudo nano /home/user/.profile

and adding this line at the end:

export PATH=/home/user/android-sdk-linux/tools/:/home/user/android-sdk-linux/platform-tools/:$PATH

Save the file and then log out/log in (or reboot if changes were made to the system-wide config file).

  • Change to the /home/user/android-sdk-linux/tools directory and start the Android SDK Manager:
cd /home/user/android-sdk-linux/tools
./android
  • Install the "Tools" by ticking the appropriate boxes -> Install Packages
  • Choose which Android version to emulate and install it.
  • Android SDK Manager -> Android 4.0.3 (API 15) (ticked) -> Install packages
  • Still within the Android SDK Manager, create a virtual machine ("AVD") with the desired Android system in it. The WXGA800 skin gives a widescreen (tablet) appearance:
Android SDK Manager -> Tools -> Manage AVDs -> New
-> Name: Android4 -> Target: Android 4.0.3 - API Level 15 -> Size (of virtual SDcard): 2 Gb -> Skin: Built-in: WXGA800 -> Hardware: Device ram size (in Mb): <click> on 1024 -> 512
-> Create AVD
At the time of the creation of the virtual machine it is possible to adjust the amount of RAM dedicated to your device (I personally only dedicate 384 Mb) or leave it at the default of 1024 Mb if your system has plenty of RAM.
  • Close the Android SDK Manager. Now the new Android virtual machine can be started from the command line terminal. (This command can also be added to a menu item.)
emulator -avd Android4
where Android4 is the name of the virtual machine created in the previous step.
  • On less powerful computers, the startup of the emulator can be slow. Be patient.

Networking for Android SDK

Networking from the Android SDK virtual machine to my host computer's wired Ethernet connection was transparent upon installation. I required no additional configuration and all networking functions were operational.

Installing an app

Netflix Android App

  • A Netflix app for the Android market is available here or through the Amazon Appstore. The Netflix app requires Android 2.3 or later. In my Android 4.0.3 emulator the stock Netflix app (from the Amazon Appstore) successfully downloads and installs and I am able to login to my account and hear audio when streaming content, but no video. I have not yet tried the XDA-developers' version.
  • A better solution is to use the Netflix in Wine bundle, which runs the Windows version of Netflix in a modified Wine environment. This solution works well.

Other references

  • A graphical installation guide Softpedia (2009).

Other Android Virtual Machines

Other Android Resources

  • AOSP -- Android Open Source Project
  • CyanogenMod -- creates custom ROMs for devices not supported by Google Android so that the open source Android OS (AOSP) can run on them. Also see their wiki.
  • F-Droid is the repository for free and open source software (almost all of it ad-free) for the Google Android platform.
Screencasts

Screencasts

Creating screencasts (screencapture)

Several methods for creating screencasts in (K)Ubuntu Linux exist.

FFMPEG with x11grab

Recent versions of FFMPEG include x11grab, a module for screen capture. This method gives the best results for screencaptures and is one of the the most flexible methods, allowing a variety of audio inputs and audiovisual output formats.

Run FFMPEG with x11grab

  • The command for 2 channel audio recording using the ALSA input is:
ffmpeg -f alsa -ac 2 -ab 192k -i pulse -f x11grab -s 1024x768 -r 30 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 /home/user/capturedvideo.avi

The order of the options is important (since some options override others). -f alsa indicates the alsa audio input (an alternative is oss). -ac 2 indicates 2 channel recording (use -ac 1 for mono). -ab 192k means 192 kb/sec audio, which may be too high for your needs. (128k is average). -i pulse indicates to use Pulse Audio (assuming you have it set up) for audio input. -i :0.0 means to capture screen 0.0 (the primary screen). -acodec pcm_s16le means to save with lossless 16-bit audio encoding (which gives a large file). You can use another audio format (such as libmp3lame) here if you wish, or re-encode later when you do processing/convert to your final desired format. Also see the FFMPEG x11grab documentation for other options.

You can also capture to a video codec other than libx264 (although without the corresponding quality of H.264/X264). In a command terminal, type ffmpeg -formats E to see which video codecs your version of FFMPEG supports. For example, to create an .avi file with an XVID video codec and an Mp3 audio codec, use the command:

ffmpeg -f alsa -ac 2 -ab 128k -i pulse -f x11grab -s 1024x768 -r 30 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -vtag xvid /home/user/capturedvideo.avi

However, I find the quality to be far superior if the capture is done in H.264/X264 and then converted to the (much smaller and more universal) XVID format in a separate step afterwards.

  • Of course, the command can be used as a Menu item. When creating a Menu item, make sure the "Advanced -> Run in terminal" box is ticked.
  • To stop the recording, enter "CTRL-C" (or "q" in earlier versions) in the terminal window in which FFMPEG/x11grab is running.
  • If you have xwininfo installed (installed already in Debian/(K)Ubuntu), you can replace
-s 1024x768
with
-s $(xwininfo -root | awk '/geometry/ {print $2}')
in order to automatically capture whatever-sized screen you have. The command would then be:
ffmpeg -f alsa -ac 2 -ab 192k -i pulse -f x11grab -s $(xwininfo -root | awk '/geometry/ {print $2}') -r 30 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 /home/user/capturedvideo.avi
  • A benefit of using Pulse Audio is that several inputs can be combined, allowing both microphone input and music input, for example. The relative volumes can be controlled using Pulse Audio Volume Control (sudo apt-get install pavucontrol).
  • If you do not have Pulse Audio installed, you can capture from the primary audio input card by replacing
-i pulse
with
-i hw:0,0
or
-i /dev/dsp
  • It is possible to record only part of the screen by specifying an offset from the upper left corner of the screen. Use the option :0.0+10,20 where 10 is an example of a x-offset from the left of the screen and 20 is an example of the Y offset from the top of the screen. Also specify the size of the area to recorded, for example -s 320x240. A complete command might then be
ffmpeg -f alsa -ac 2 -ab 128k -i pulse -f x11grab -s 320x240 -r 30 -i :0.0+10,20 -acodec libmp3lame -vcodec mpeg4 -vtag xvid /home/user/capturedvideo.avi
  • After completing the screencapture, you can then edit and convert it to the desired final format, using FFMPEG (perhaps with the WinFF GUI), mencoder (with or without a front-end such as Avidemux), or a standalone video editor. Some examples of conversion methods are here.

kX11grab

kX11grab is the KDE version of QtX11grab, a frontend for FFMPEG/x11grab screengrabs. It is in alpha stage and does not yet work well.

  • Install kx11grab:
sudo apt-get install kx11grab
  • Start kX11grab:
K menu -> Utilities -> kx11grab

Install the newest version of FFMPEG with x11grab

  • Older repository-supplied versions of FFMPEG did not have X11grab nor X264 support in them. If you have a very old installation, you can install the newest version of FFMPEG and X264 using the instructions from this thread.

Note: The current, updated versions of FFMPEG in Lucid, Maverick, and Natty are all compiled with x11grab and X264 capabilities. On my Lucid machine, X264 version 85 is already installed, and on Natty, version 106 is already installed. The newest version of X264 (as of 8-2011) is version 116.

If you want the most current version of FFMPEG and the H.264 / X264 video codec, however, then compile and install new versions using these instructions (recreated here).

  • Uninstall x264, libx264-dev, and ffmpeg:
sudo apt-get remove ffmpeg x264 libx264-dev
  • Install dependencies needed for retrieving, compiling, and running the new versions (you may need to ensure the Universe and Multiverse repositories are enabled):
sudo apt-get update
sudo apt-get install build-essential checkinstall git libfaac-dev libjack-jackd2-dev
sudo apt-get install libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev
sudo apt-get install libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html
sudo apt-get install yasm zlib1g-dev
  • Retrieve, compile, and install a new version of the X264 video codec from VideoLAN (makers of VLC). (Note: Ubuntu normally installs x264 in /usr/bin/x264.):
cd
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh|awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes --fstrans=no --default
Note: Git uses port 9418 by default. Make sure the Git port is unblocked in your firewall. The last command will build a .deb package named something similar to /home/user/x264/x264_0.116.2074+git2641b9e-1_i386.deb. The installed package can be removed later, if desired, using dpkg -r x264.
  • Retrieve, compile, and install a recent version of FFMPEG. (Note: Ubuntu normally installs FFMPEG in /usr/bin/ffmpeg and related modules in /usr/bin/ffplay, /usr/bin/ffprobe, /usr/bin/ffserver, and /usr/bin/qt-faststart.):
cd
git clone git://git.videolan.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default
hash x264 ffmpeg ffplay ffprobe
Note: Git uses port 9418 by default. Make sure the Git port is unblocked in your firewall. The second-to-last command will build a .deb package named something similar to /home/user/ffmpeg/ffmpeg_201109031233-git-1_i386.deb. The installed package can be removed later, if desired, using dpkg -r ffmpeg.
  • Some programs may expect ffmpeg to be in /usr/bin, so create a symbolic link:
sudo ln -s /home/user/ffmpeg/ffmpeg /usr/bin/ffmpeg

Add a webcam to a screencast

  • To show your webcam in your screencast, install one of three webcam applications:
  • Cheese (sudo apt-get install cheese) is a Gnome-based webcam application with many options and a re-sizable window.
  • Kamoso (sudo apt-get install kamoso) is a KDE-based webcam application.
  • Xawtv (sudo apt-get install xawtv) is a Gtk-based application. Because the Xawtv window can be arranged so that only the webcam image is shown, it is my favorite webcam display for screencasts. (Click on "X" in the window bar -> Advanced -> No Border (ticked) .)

Any of these applications can be used in (K)Ubuntu.

Start the desired application until your webcam is showing. Position the webcam image on your desktop as desired. Now start your screencapture and the webcam window will be included.

Record microphone and speaker output simultaneously

This example assumes Pulse Audio is installed on the system. This was tested on Natty.

  • Make sure PulseAudio Volume Control is installed:
sudo apt-get install pavucontrol
  • Start FFMPEG/x11grab as above:
ffmpeg -f alsa -ac 2 -ab 192k -i pulse -f x11grab -s $(xwininfo -root | awk '/geometry/ {print $2}') -r 30 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 /home/user/capturedvideo.avi
  • Start an audio application (such as Audacious, Amarok, Rhythmbox, etc.) so that some audio output is playing through the speakers.
  • Start PulseAudio Volume Control:
Menu -> Multimedia -> PulseAudio Volume Control
  • Select as an input "Monitor of Internal Audio Analog Stereo":
PulseAudio Volume Control -> Input Devices -> Show: All Input Devices
-> Make sure Monitor of Internal Audio Analog Stereo is not muted (click on speaker icon)
  • Make sure your microphone is plugged in.
  • Select as an input "Internal Audio Analog Stereo: Analog Microphone":
PulseAudio Volume Control -> Input Devices -> Show: All Input Devices
-> Make sure "Monitor of Internal Audio Analog Stereo: Port: Analog Microphone " is not muted (click on speaker icon)
  • Make sure the "Internal Audio Analog Stereo" device is selected for the ALSA plug-in [ffmpeg] application:
PulseAudio Volume Control -> Recording -> ALSA plug-in [ffmpeg]: ALSA capture from: Internal Audio Analog Stereo

recordMyDesktop

  • gtk-recordMyDesktop -- a one-step solution. Audio can be captured as well, including through the microphone (whichever inputs are enabled in the mixer/pulse audio system will be captured). Even a virtual machine like VirtualBox can send its audio through the Pulse Audio system, so it can also be captured. The recorded .ogv file can then be converted to a Flash video (.flv) with:
mencoder -ovc lavc -ofps 30 -oac mp3lame -af volnorm=1:0.5 your_file.ogv -o your_file.flv
or to an .avi (for use with Avidemux, for example):
mencoder -ovc lavc -ofps 30 -oac mp3lame -af volnorm=1:0.5 your_file.ogv -o your_file.avi
  • If mencoder is not installed:
sudo apt-get install mencoder

xvidcap with Audacity

Using VNC to capture another computer's screen

Troubleshooting tips

A method that has worked for me in the past is the method described using Avidemux. I use either gtk-recordMyDesktop or xvidcap to capture the video, as above (saving as an .avi). The problem for me is that Avidemux is rather particular about the audio formats it will accept. I have found that it will not accept many mp3 files (depending on the codec originally used to create the mp3 file). However, I have found that if I import any mp3 file into Audacity and then re-export it as an mp3, Audacity will re-encode it with a codec (libmp3lame) that Avidemux likes.

I can therefore combine the .avi video with the .mp3 audio (created by Audacity) using Avidemux.

Screencasts in Windows

Some users will run (K)Ubuntu in a virtual machine (VirtualBox, VMWare, QEMU) in Windows. For those users who wish to record a screencast, there are two good open source screen recording utilities:

  • CamStudio -- works similarly to gtk-recordMyDesktop, with capabilities of converting to Flash videos (.flv and .swf). Records audio and video with options for annotation and other effects.
  • Wink -- essentially a screen capture, it is good for animations with each frame individually constructed. It can output to a video file, including Flash videos.

Examples

Exercise: Slideshow with audio track

This may seem a bit cumbersome, but it works for me. If you have a better method please add it! (Note: I now use the FFMPEG with x11grab method at the top of this page. This method below was how I originally did it.)

  • Gwenview is installed by default in Kubuntu. I then install Avidemux, Audacity, gtk-recordMyDesktop, mencoder, ffmpeg, and kubuntu-restricted-extras.
  • Start gtk-recordMyDesktop but do not use the sound recording portion (leave the Sound Quality box unticked). I find that gtk-recordMyDesktop audio recording is choppy and therefore less than desirable for me (even on my dual-core 64-bit system with 3 Gb RAM).
  • Start Gwenview and find the folder with your pics that will be made into a slideshow. Start gtk-recordMyDesktop recording and the start the slideshow (Gwenview -> View - Start Slideshow). Record until all the slides have displayed. Then stop gtk-recordMyDesktop recording. The file will be saved as an .ogv file (such as MyRecordedFile.ogv).
  • Convert the .ogv file to an .avi file:
mencoder -ovc lavc -ofps 30 -oac mp3lame -af volnorm=1:0.5 MyRecordedFile.ogv -o MyRecordedFile.avi
  • Create your soundtrack from mp3's or recorded files using Audacity.
  • If you wish to join several mp3 files into a single mp3, you can concatenate them:
cat File1.mp3 File2.mp3 File3.mp3 > CombinedFile.mp3

Import the mp3 file into Audacity and edit as desired. Export the resulting edited file into a new mp3 file (such as MyAudacitySoundtrackFile.mp3). Even if you make no edits, you should re-export every mp3 using Audacity because Avidemux doesn't always recognize the codecs originally used to create many mp3s (but it always recognizes the mp3s exported by Audacity).

  • Open Avidemux. Open your video file (Avidemux -> File -> Open -> MyRecordedFile.avi).
  • If you wish to trim the file, move the A and B markers to the beginning and end of the desired segment.
  • Add the soundtrack you created with Audacity. (Avidemux -> Audio -> Main Track ... -> Audio Source: External MP3 -> External File: MyAudacitySoundtrackFile.mp3)
  • Save the file with the new soundtrack. (Avidemux -> File -> Save -> Save Video... -> MyNewCombinedFile.avi)

This file can be uploaded directly to YouTub or other sites, or you can convert it into a Flash video:

mencoder -ovc lavc -ofps 30 -oac mp3lame -af volnorm=1:0.5 MyNewCombinedFile.avi -o MyNewCombinedFile.flv

Conversion / Editing

Netflix

Netflix in Wine app

A (Windows-based) Netflix app (32-bit version) has been modified and bundled to work in the Wine environment. It is available as a package from a private (non-approved) repository here.

  • To run the app will require a 32-bit operating system, which on a 64-bit system might require installing ia32-libs (and/or ia32-libs-multiarch):
sudo apt-get install ia32-libs-multiarch ia32-libs
For help with installing ia32-libs-multiarch (ia32-libs), see this section.
Menu -> System -> Muon Package Manager -> Settings -> Configure Software Sources -> Kubuntu Software -> Software restricted by copyright or legal issues (multiverse) (ticked) -> Close
  • Then install the Netflix-desktop:
sudo apt-add-repository ppa:ehoover/compholio
sudo apt-get update
sudo apt-get install netflix-desktop
  • Correct any package installation errors:
sudo apt-get install -f
sudo dpkg --configure -a
  • The package installs the Microsoft core fonts (ttf-mscorefonts-installer). During this part of the installation a prompt to accept the Microsoft EULA will appear. Use the "TAB" key to maneuver to the "Ok" button and then press "Enter" to accept. The installation should then continue to completion.
  • The package creates a menu item for the Netflix Desktop, or the app can be started from a terminal with a command. (I start it the first time from the command-line so I can watch the completion of the final installation steps, which occurs with the initial run.):
netflix-desktop
  • The Netflix app starts in full screen mode. You can exit out of the app completely by pressing ALT+F4 or by using the pop-up "X." You can also press F11 to exit out of full screen mode.
  • From time to time the Netflix app (in Windows) is significantly updated. On two occasions I have needed to uninstall the Netflix-desktop package completely, obtain the newest package version from ehoover's repository, and re-install it.
  • My personal preference was to create and dedicate a new partition for the Netflix installation only. I installed a new 32-bit version of (K)Ubuntu into this partition and then installed the Netflix / modified Wine bundle in this new partition's OS. In total, about 3.75 Gb of space was used for this minimum combination. I made the entire partition 10 Gb (in order to allow for caching and other temp data that might be required). This barebones setup plays Netflix quite nicely. Netflix can then be made to start automatically at bootup of this partition's OS by adding the netflix-desktop to the Kubuntu autostart menu:
Settings -> System Settings -> Startup and Shutdown -> Autostart ->
-> Add Program -> Multimedia -> Netflix Desktop
I also turn off the screensaver and prevent screen-dimming:
Menu -> Settings -> System Settings -> Display and Monitor -> Screen Saver
->Start automatically after... (unticked) -> Apply
Menu -> Settings -> System Settings -> Power Management -> Energy Saving Settings
-> Dim Display (unticked) -> Screen Energy Saving (unticked) -> Apply
Note: I currently have Netflix-desktop running on a a 32-bit Precise Pangolin installation (easiest and fastest), a 64-bit Precise Pangolin installation (difficult to install), and a 32-bit Kubuntu Trusty Tahr installation (acceptable). On two older systems (one with Intel graphics and one with nVidia graphics), Silverlight in Netflix-desktop will not play (though it plays under Windows on the same machines).
Troubleshooting
  • On some of my systems, installing a full Mono setup (sudo apt-get install mono-complete) worked better prior to installing the Netflix-desktop. After doing this, I then answered "No" whenever the Netflix-desktop installer prompted me to install mono.
  • For both updates and troubleshooting, the following steps also seemed to be necessary for me. See this discussion.
  • Remove the netflix-desktop and the wine-browser settings folder, reinstall the netflix-desktop, then restart netflix-desktop in order to complete the reinstallation:
sudo apt-get purge netflix-desktop
rm -rf ~/.wine-browser/
sudo apt-get install netflix-desktop
netflix-desktop
Installing Netflix for multiple users
  • I successfully installed Netflix-desktop under multiple user profiles. To do so, I installed Mono systemwide first (from the primary adminstrative user's account):
sudo apt-get install mono-complete
  • During the Netflix-desktop installation process, I temporarily made each user an "Administrator" (i.e. gave them administrator privileges):
Settings -> System Settings -> User Manager -> user -> Administrator (ticked)
  • I then used the "reinstallation" steps for Netflix-desktop while logged into that user's profile:
sudo apt-get purge netflix-desktop
rm -rf ~/.wine-browser/
sudo apt-get install netflix-desktop
netflix-desktop
Because Mono was already installed, I then answered "No" whenever the Netflix-desktop installer prompted me to install mono.
  • After ensuring that the Netflix-desktop functioned correctly, I revoked the administrator privileges for those accounts I no longer wished to have them.
Settings -> System Settings -> User Manager -> user -> Administrator (unticked)
  • Once properly installed the Netflix-desktop worked without problems whether the user was an administrator or not.
Playing Netflix through an HDMI connection
  • Many of my computers have an HDMI output and I like to stream Netflix to the television using an HDMI cable. This works nicely once the necessary outputs are configured.
sudo apt-get install pavucontrol
  • With the HDMI cable plugged into the computer and the TV powered on, allow HDMI output from Pulse Audio:
PulseAudio Volume Control -> Configuration -> Profile: Digital Stereo (HDMI) Output
  • For the video, choose the appropriate monitor settings to play through HDMI (while the HDMI cable is plugged into the computer and the TV powered on):
Settings -> System Settings -> Display and Monitor -> HDMI -> Apply
Note: It may be necessary to logout then login again for the settings to take effect.
Note: For my system with an nVidia graphics card and proprietary driver, the HDMI video display output is chosen through the nVidia Settings utility.
  • After configuring the outputs, start Netflix-desktop and it will play through HDMI.
  • Troubleshooting: Sometimes the cable must be unplugged and replugged (and the TV powered on) for the system to recognise the HDMI output. On some systems the cable must be plugged in (and the TV powered on) at boot/login in order for the HDMI output to be recognised properly.

Netflix through the Chrome browser

  • Update: According to this article, a development version of the Google Chrome browser is no longer required. The following information is maintained for legacy reference.
  • Netflix streaming (using HTML5) works with the latest Google Chrome browser. See these tips. Chrome (but not Chromium) has the needed DRM module (Google's WidevineCDM), as well as the required version of Pepper Flash, built into the development version. The stable version (v. 36) of the Chrome browser does not have these modules. (Packaged versions of the related open-source Chromium browser (also see here) do not seem to have these modules as well, and though Pepper Flash can be added, there is no availability of the WidevineCDM module for Chromium at this time).
  • Download and install the development version (v. 38) of the Google Chrome browser directly from Google here.
  • Some users indicate that the Beta version (v. 37) of the Google Chrome browser (available here) works for them, but I have not verified this.
  • Verify that the required Widevine and Flash modules are installed in your version of Chrome.
Google Chrome -> Address bar: chrome://plugins
Both the required modules should be visible:
  • Widevine Content Decryption Module
  • Adobe Flash Player Version
This should be a PPAPI Version 11.7 or greater (mine is Version 14.0)
  • According to this thread, your libnss3/libnss3-ld libraries must be at least 3.16.2 (to resolve error M7063-1913). This version is in the Utopic repositories.
  • Temporarily install the Utopic repositories, install/update the required modules, then uninstall the Utopic repositories (so that they do not interfere with your current repositories).
  • Alternatively, download and install libnss3 and libnss3-1d manually from the Utopic repositories.
  • Install the User Agent as described.
Google Chrome -> Customize and control icon -> Settings -> Extensions -> Get more extensions -> Search: User Agent Switcher
-> User Agent Switcher for Chrome -> + Free (Install) -> Add
  • Set the User Agent to "spoof" a Windows version of the Chrome browser.
  • Google Chrome -> <Right-click> on User Agent Switcher mask icon -> Options ->
New User-agent name: Chrome Windows -> New User-agent string: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2114.2 Safari/537.36
-> Indicator Flag: CW -> Add
  • Google Chrome -> <Left-click> on User Agent Switcher mask icon -> Chrome -> Chrome Windows
  • Some users optionally set up permanent spoofing for netflix.com:
Google Chrome -> <Right-click> on User Agent Switcher mask icon -> Options -> Permanent spoof list -> Domain: netflix.com -> Add
  • Navigate to Netflix and test the setup.
  • Some users change their preferred streaming to HTML5 within the Netflix settings, but others indicate that this isn't necessary.
Netflix -> Your account -> Playback settings -> Preferences: Prefer HTML5 player instead of Silverlight (ticked)
  • The Widevine Media Optimizer modules supplied by Google are for Windows and Mac OS and do not work in Linux (outside of Wine). The Widevine modules of the Pipelight project do not work with either the Chrome or Chromium browsers (for me). Pipelight is not necessary (or advised) for this method.
  • Create a menu item to launch the Google Chrome browser directly into Netflix. For the menu item command, use:
/usr/bin/google-chrome-unstable http://netflix.com
  • Installation of the Google Chrome browser also adds a Google repository to your software sources. According to the Google Chrome installation instructions, this can be prevented (prior to Chrome installation) by running:
sudo touch /etc/default/google-chrome
However, this did not prevent the Google repositories from being installed on my system. Therefore, after installation I disabled the Google repositories manually (so that they would not interfere with the Ubuntu repositories).
  • On my systems (both Precise and Trusty), the Compholio (modified-Wine) version (above) has better performance than playing Netflix through HTML5 on the Google Chrome browser. (Perhaps this is because Firefox is used as the browser in that setup and is somewhat faster.) YMMV.

Netflix Android App

A Netflix app for the Android market is available here. It must be installed in an Android environment but in the past has not been fully functional in the current Android emulators.

Streamripper

  • Streamripper is a standalone command-line utility to record online audio streams (primarily from Shoutcast). Install:
sudo apt-get install streamripper
  • Read the instructions from the command line:
man streamripper
  • Find out the URL (e.g. http://208.85.242.52:8028) of the streaming broadcast you wish to record (either from Shoutcast or through Amarok, for example). Make sure your firewall is open for the relevant port (in the example port 8028).
  • Start Streamripper, saving the files to your chosen directory (e.g. /home/user/recordedmusic):
streamripper URL -d /home/user/recordedmusic
or, in the example:
streamripper http://208.85.242.52:8028 -d /home/user/recordedmusic
  • The most common problem with captures is the break point between songs. It may be necessary to adjust the breakpoint.
  • Each of my songs contain about 2 seconds (2000 milliseconds) of the previous song. How can I fix this?
streamripper URL -d /home/user/recordedmusic --xs_offset=2000
  • Each of my songs contain about 2 seconds (2000 milliseconds) of the next song. How can I fix this?
streamripper URL -d /home/user/recordedmusic --xs_offset=-2000
  • Each of my songs contain between 5 and 10 seconds of the previous song, but it depends on the song. How can I include all of this zone within both songs, and edit them later?
streamripper URL -d /home/user/recordedmusic --xs_offset=7500 --xs_padding=2500:2500
  • Use Audacity to edit the ripped audio file.

Troubleshooting

  • Make sure to read all the instructions:
man streamripper
  • If a song occurs twice in a stream, the default behaviour is to write both songs, numbering the duplicates (the -o version option). If you wish to instead only keep the largest copy of a song (assuming the smaller copies are truncated in some way by the break point algorithm), then use the -o larger option. This will overwrite the original copy of the song only if the new copy is larger. Example:
 streamripper http://208.85.242.52:8028 -o larger -d /home/user/recordedmusic --xs_offset=2000 --xs_padding=3000:3000
  • Streampripper identifies itself as "Streamripper/1.x" in the http request. If you wish some privacy and to specify a different user agent, use the -u useragent option. For example:
  streamripper URL -d /home/user/recordedmusic -u SimplePlayer/1.x -o larger --xs_offset=2000 --xs_padding=3000:3000

Video Conversion

This guide does not advocate the illegal duplication of copyrighted content. However, fewer and fewer devices use DVDs any longer, and a large amount of video content is distributed on DVDs. It becomes necessary to convert video content into formats that can be viewed on devices that no longer used DVDs. Furthermore, online content is often in a format that is not universally playable and this also requires conversion. Trying to select and encode a video into a format which your device accepts is not always a straightforward task.

Introduction

There are lots of video and audio codecs and lots of methods and preferences for converting between formats. These are only some basic examples. A good deal of trial and error is often required for successful video conversion.

  • Mencoder and FFMPEG are the two packages that are the workhorses of video conversion. Of these, mencoder is faster and generally gives better results.
  • Handbrake uses a streaming algorithm and FFMPEG to "rip" DVDs and can work with many different encryption methods. It uses the (superior, open source) .MKV container only, however (which is not supported by many devices). It also does not support XVID (and uses either X264/H.264 or MP4 video codecs) and therefore its video output is also not universally accepted by a wide range of devices. As these standards become more widely accepted, however, this will be an invaluable encoding tool. On rare occasions I rip a video with Handbrake (to .MKV and H.264/MP3) and then convert it to .AVI (XVID/MP3) in a second step (using mencoder).
  • When I originally wrote these articles, .MKV was accommodated by only a handful of DVD players. A recent survey of new DVD players shows that most (including widely available inexpensive DVD players) will now play files in .MKV format. In fact, it is now difficult to find DVD players that will still play .AVI with XVID / DivX video. However, over the years I have accumulated a very large collection of .AVI / XVID / MP3 videos. In 2013, there were only a limited number of DVD players that advertised DivX and .AVI compatibility that I could find (including some Philips players) that would play them all. Check compatibility charts for players carefully if you find yourself with a large collection of .AVI / XVID video files.

Mencoder

Mencoder is part of the MPlayer set of libraries (that also uses several of the FFMPEG libraries) for audio/visual conversion. If it is not installed on your system, install it:

sudo apt-get install mencoder

Usage instructions can be found from the command-line (man mencoder) or here.

MP4 with AAC audio to AVI with Xvid / MP3

  • The AAC audio codec is not compatible with many DVD players and devices due to licensing restrictions, whereas the MP3 audio codec is nearly universally accepted. Xvid is the open source version of the DivX video codec and is accepted by a very large number of DVD players and other devices (even older ones, especially those displaying the DivX logo).
  • The .AVI container only allows a constant bitrate, so the MP3 audio must be encoded at CBR. If the AAC is 5.1, it will be downcoded to stereo for MP3.
  • This example is a two-pass technique that allows the file size to be specified and quality optimized for that filesize (using the information generated in the first pass). In this example, a 700 MB file is desired (and is specified by the negative value of 620000, which by a quirk of mencoder gives an approximately 700 MB file).
mencoder <input.mp4> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=1 -o /dev/null
mencoder <input.mp4> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-620000 -o <output.avi>
  • This basic command can be used for most input formats. For example, <input.mp4> can be replaced with <input.mkv> (for .MKV videos) or with <input.wmv> (for .WMV videos).

DVD to AVI with Xvid / MP3

  • See the mencoder documentation.
  • Extract a video (in the .vob format) from a DVD to a file with an .AVI container and XVID/DivX video and .MP3 audio using this (2-pass conversion) command:
mencoder dvd://1 -vobsub 999 -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=1 -o /dev/null
mencoder dvd://1 -vobsub 999 -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-620000 -o <output.avi>

where dvd://1 indicates the first track of the DVD.

  • If you are not sure which track contains the content you wish to extract to a file, one way to check this is to play the DVD with a media player like VLC, examining the tracks on it:
VLC -> Media -> Open Disc... -> Play -> Playback -> Navigation

or from the command line install lsdvd (sudo apt-get install lsdvd) and use it:

lsdvd -v -t 1 /dev/dvd

This will show a list of the title numbers (for the content tracks) on the DVD (and information about them). Use the title number for the content to be extracted.

  • Conversion is much faster when done from from a hard drive than from a physical DVD. It is possible to copy the VIDEO_TS and AUDIO_TS folders from the physical DVD to a folder on the hard drive. Once you have copied the contents of the DVD to a folder, add the -dvd-device /path/to/dvd_folder option to specify it (with the same options as above in addition to the new one):
mencoder dvd://1 -dvd-device /path/to/dvd_folder
  • Note the -vobsub 999 option to prevent subtitles from being automatically added. (If you wish to hardcode subtitles, use the number of the subtitle track, such as -sid 0 or -vobsubid 0 for the default subtitle track or -sid 1 or -vobsubid 1 for the next subtitle track. Note that mencoder numbers tracks from 0, so that subtitle track 1 would be designated -sid 0.)
  • When better audio quality is desired, an audio bitrate more than 128 kb/sec can be used (e.g. br=160 or br=192), but this will give a larger file (or will decrease video quality if the filesize remains constant). cbr (constant bitrate) is used for mp3lame encoding in .AVI; I generally increase the volume of the video by 30% using the vol=3 option, as well. My final audio command therefore usually ends up: -oac mp3lame -lameopts cbr:br=128:vol=3.
  • If there are multiple audio tracks, the audio track can be selected with the -aid 1 (or similar) option, specifying the number of the desired audio track. (Note: check audio track numbering carefully.) The English default audio track is usually -aid 128. To show information about the audio tracks, use
lsdvd -a -t 1 /dev/dvd
  • Although the bitrate=-700000 option specifies a target file size of 700000 (approx. 700 MB), this actually results in a file size of nearly 800 MB. Specify a target filesize about 15% less than actually desired, therefore. For a target 700 Mb file, for example, I use bitrate=-620000.
  • For XVID there is an option to allow video seeking (for fast forwarding or rewinding) in 1 second increments (instead of the default 10 second increments): -xvidencopts max_key_interval=25 (seek every 25 frames instead of the default 250 frames). This would be included as part of a more complex option string, such as -xvidencopts pass=2:max_key_interval=25:bitrate=-620000.
  • In order to play the converted .AVI file on my older DVD players and televisions (and avoid significant motion artifacts and pixelation), I find that I must use deinterlacing. Only two interlacing methods have worked well for me: -vf pp=lb or -vf yadif=0. There are many methods of deinterlacing for mencoder, however (see here and here, for example). Deinterlacing may not be necessary for your needs (when used for archival purposes only, for example, or if viewing files with media players (such as VLC) that already have built-in deinterlacing capabilities). Often recommended when ripping NTSC-format movies (progressive or telecined) is to include the option -vf pullup,softskip,harddup, which must be used with a deinterlacing filter, such as -vf pullup,softskip,pp=lb,harddup (or -vf pullup,softskip,yadif=0,harddup). The order of the telecine/progressive option, the deinterlacing option, and any cropping or scaling options is very specific -- read the mencoder documentation carefully when mixing these options. Specifically, cropping and scaling (when used) should be done after the telecine/progressive/deinterlacing options but before the frame duplication option, e.g. -vf pullup,softskip,pp=lb,crop=720:416:0:80,scale=704:304,harddup.
  • Note: You will need libdvdcss2 installed on your system to access DVD data. If your DVD has encryption that is not able to be decrypted by libdvdcss, then consider using Handbrake, which uses a streaming algorithm to "rip" DVDs.
  • This is the 2-pass command I end up using most often (with 4:3 NTSC videos):
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,scale=640:480,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=1 -o /dev/null
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,scale=640:480,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=2:max_key_interval=25:bitrate=-620000 -o <output.avi>
or
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=1 -o /dev/null
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=2:max_key_interval=25:bitrate=-620000 -o <output.avi>
Note: While scale=720:540 will also give a 4:3 aspect ratio (1.33), many TVs will only allow a maximum height of 480, so I do not use it. Also note that not specifying the scale (as in the second command example) always gives a default 720:480 aspect ratio (which is a 1.5 ratio instead of 1.33), which may distort the aspect somewhat. I therefore no longer use this second command example and instead specify the aspect ratio explicitly (as in the first command example).
  • This is the 2-pass command I end up using most often (with 16:9 NTSC videos):
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,scale=720:406,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=1 -o /dev/null
mencoder dvd://1 -dvd-device /path/to/dvd_folder -vf pullup,softskip,pp=lb,scale=720:406,harddup -vobsub 999 -aid 128 -ovc xvid -oac mp3lame -lameopts cbr:br=128:vol=3 -xvidencopts pass=2:max_key_interval=25:bitrate=-620000 -o <output.avi>
The scale option is set for use on most widescreen TVs. However, an alternative is to use scale=648:364 so that I can play the video on analogue televisions with overscan (I still have a few of those).

Using k9copy as a conversion front-end

  • k9copy is a good front-end for mencoder (as well as ffmpeg).
  • To add an option to encode to XVID from an NTSC DVD (when using mencoder within k9copy), I add the necessary options to the Video codecs section:
k9copy -> Configure k9copy -> Encoders -> mencoder -> Add -> label: XVID from NTSC -> first pass ->
-ovc xvid -xvidencopts bitrate=$VIDBR:turbo:pass=$PASS:aspect=$ASPECT -vf pullup,softskip,pp=lb,crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT,harddup

The same command is entered for the "second pass" option as well. For the "one pass" option enter:

-ovc xvid -xvidencopts bitrate=$VIDBR:aspect=$ASPECT -vf pullup,softskip,pp=lb,crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT,harddup
  • To then use this new Video codec option, make sure it is selected:
k9copy -> Configure k9copy -> MPEG-4 -> Video -> Codec -> XVID from NTSC -> 2 pass (ticked) -> Apply

At the same time, the MP3 (lame) Audio codec option can be selected:

k9copy -> Configure k9copy -> MPEG-4 -> Audio -> Codec -> mp3 (lame) -> OK
  • Now when the Output: MPEG-4 encoding is selected from the main screen, this "XVID from NTSC" Video encoding option will be used.
  • Note that the -vf pullup,softskip,pp=lb,crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT,harddup option can be used with any Video codec, not just XVID.

AVI to MPG

  • The MPG format is sometimes useful for creating DVDs (using the MPEG-1 or MPEG-2 video codec, which can be then used for conversion to vob files. If the audio codec of the AVI file is already AC3 or MP3, it usually can be copied. This example is taken from the MPlayer/Mencoder documentation. Example:
mencoder <input.avi> -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy -o <output.mpg>

Increase volume

  • Use the -af volume=3:0 option, where the first number (3 in the example) is the number of decibels to increment the volume (a 3 db increment doubles the volume), and the second number is 0 for hard-clipping and 1 to allow software-based clipping (to prevent oversaturation when the sound becomes too loud).

For example, if I want to double the sound volume of my .AVI video:

mencoder <input.avi> -ovc copy -oac mp3lame -lameopts cbr:br=128 -af volume=3:0 -o <output.avi>
  • This can also be done when encoding to the mp3lame audio codec by adding an option to the mp3lame options:
mencoder <input.avi> -ovc copy -oac mp3lame -lameopts cbr:br=128:vol=3 -o <output.avi>
where vol=3 can be set to any value between -10 and 10. I use vol=3 to increase the volume 30%. (This method works best for me.)

Re-synchronize audio with video

If the audio track is out of synch with the video, it can be adjusted using the -audio-delay [sec] option. For example, if it is found (using VLC -> Tools -> Track Synchronization, for example) that the required delay is 0.700 sec, then re-encode using -audio-delay 0.700:

mencoder <input.avi> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -audio-delay 0.700 -xvidencopts pass=1 -o /dev/null
mencoder <input.avi> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -audio-delay 0.700 -xvidencopts pass=2:bitrate=-620000 -o <output.avi>

Add subtitles to video

  • .srt subtitle files are essentially text files with time stamps. They are meant to be used with digital video files (such as .AVI files) and are different from the image-based .idx / .sub subtitle files (vobsub) used with the .vob format found on commercial DVDs.
  • Using mencoder:
mencoder -ovc [codec] [codec opts] -oac copy -sub [sub file.srt] -subfont-text-scale [3 normally]

In the example above, this would be:

mencoder <input.mp4> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-620000 -sub <subtitles.srt> -subfont-text-scale 3 -o <output.avi>
  • If the subtitles are too low or too high on the screen, they can be positioned so that the top edge of the subtitles are at a different position using the -subpos 95 option, where the number specifies the percentage from the top of the screen where the subtitles will be placed. For example, if using the value 95, the top of the subtitles will be placed 95% down the screen. The full command would then be, for example:
mencoder <input.mp4> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-620000 -sub <subtitles.srt> -subfont-text-scale 3 -subpos 95 -o <output.avi>
  • Full subtitle options can be found in the manual (available from the command-line terminal): man mencoder
  • Note: When adding subtitles to an .AVI video, you must transcode it completely. It is not sufficient to merely add the subtitle track as listed above -- the entire video must be re-transcoded. So, for example:
mencoder <input.avi> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=1 -o /dev/null
mencoder <input.avi> -ovc xvid -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 -sub <subtitles.srt> -subfont-text-scale 3 -o <output.avi>

Trim a video

  • Using mencoder:
mencoder <input.avi> -ovc copy -oac mp3lame -ss 01:57:12 -endpos 00:04:08 -o <output.avi>

where -ss indicates the start position of the clip (hh:mm:ss) and -endpos indicates how long the clip should be. (I use mp3lame for the audio codec because YouTube accepts that.)

Resize a video

  • Using mencoder:
mencoder <input.avi> -ovc xvid -vf scale=320:240 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 -o <output.avi>

where -vf scale=320x240 indicates that the resulting video should be of that size. The position of the suboption in the command string is important.

  • HDTV resolution is usually 1920 x 1080 ("1080p") or 1280 x 720 ("720p"). A standard definition widescreen TV has a maximum height of "480p" (usually 853 x 480 but often 720 x 406). The standard width:height aspect ratio for cinema is 1.85:1 (although increasingly the original filming aspect of 2.35:1 is being used), whereas the average aspect ratio for widescreen movies distributed for display on television is 16:9 (1.77:1). When resizing a video, it is good to know the original dimensions of the video and maintain the width to height aspect ratio in the chosen scale.
  • Example: An HQ video is distributed as 1280 x 692 (which has an aspect ratio of 1.85:1). The device (a low resolution television) on which it is to be displayed has a maximum width of 720. The desired resolution would then be 720 x 390 to keep the aspect ratio at approximately 1.85:1. The option would then be -vf scale=720:390. An analog television would require 10% overscan, making the maximum width 648. To keep an aspect ratio of 1.85:1 would require a resolution of 648 x 350, or a scale option of -vf scale=648:350.
  • Example: An HQ video is distributed as 1280 x 544 (which has an aspect ratio of 2.35:1). The device (a low resolution television) on which it is to be displayed has a maximum width of 720. The desired resolution would then be 720 x 306 to keep the aspect ratio at approximately 2.35:1. The option would then be -vf scale=720:306. An analog television would require 10% overscan, making the maximum width 648. To keep an aspect ratio of 2.35:1 would require a resolution of 648 x 272, or a scale option of -vf scale=648:272.
  • Example: An HQ video is distributed as 1920 x 1080 (which has an aspect ratio of 16:9, or 1.77:1). The device (a low resolution television) on which it is to be displayed has a maximum width of 720. The desired resolution would then be 720 x 406 to keep the aspect ratio at approximately 16:9. The option would then be -vf scale=720:406. An analog television would require 10% overscan making the maximum width 648. To keep an aspect ratio of 16:9 would require a resolution of 648 x 364, or a scale option of -vf scale=648:364.
  • Example: An HQ video is distributed as 960 x 720 (which has an aspect ratio of 1.33:1). The device (a low resolution television) on which it is to be displayed has a maximum width of 720. The desired resolution would then be 720 x 540 to keep the aspect ratio at approximately 1.33:1. The option would then be -vf scale=720:540. An analog television would require 10% overscan, for which the original standard dimensions 640:480 would suffice. To keep the aspect ratio of 1.33:1 and a resolution of 640 x 480, use the scale option of -vf scale=640:480.
  • It is possible to use VLC to determine the aspect ratio of the original video while it is playing:
VLC -> Tools -> Codec Information -> Stream 0: Resolution

Cropping and Scaling

  • The -vf filters operate on the video in the order they are loaded. The crop filter uses width:height:x-offset:y-offset. (The default x-offset and y-offset is centered, so these are optional.) For example, to first crop the 688x464 region of the picture with upper-left corner at (x=12,y=4) and then scale the result down to 640x464, the following chain is used:
-vf crop=688:464:12:4,scale=640:464

If I want to remove subtitles (-sid 999), crop out black bars and extraneous noise at the top/bottom of an .mkv video, scale it, and convert to an .avi format, an example command might be:

mencoder <input.mkv> -sid 999 -ovc xvid -oac mp3lame -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=1:bitrate=-620000 -vf crop=1280:688,scale=720:406 -o <output.avi>

Convert to .MP3 audio file

  • To use Mplayer to extract audio from an .avi file to an ,mp3 .wav file:
mencoder <input.avi> -of rawaudio -oac mp3lame -ovc copy -o <output.mp3>
  • This can be combined with start markers (-ss hh:mm:ss) and a length marker (-endpos hh:mm:ss) to extract only a segment of audio from an .avi file. In the following example, only audio from starting position at 3 minutes 45 seconds with a length of 2 minutes 4 seconds will be extracted:
mencoder <input.avi> -ss 00:03:45 -endpos 00:02:04 -of rawaudio -oac mp3lame -ovc copy -o <output.mp3>
  • (Under construction) To use Mplayer to extract audio to a pcm .wav file:
mplayer <input.avi> -vc null -oa pcm -aofile -ss 1441.4 -endpos 260.1 <output.wav>   
  • Then convert the .wav file to .mp3 with your favourite converter (such as Audacity or SoundConverter).
  • I often use FFMPEG or Audacity and find them to be easier for this task.

Change audio track of video

  • In general, Avidemux is a good video editor for most needs, including muxing and demuxing video and audio.
  • For a quick method to change the audio for a video, I like to merely remove the audio from the original video file using the -nosound option, for example:
mencoder <input.avi> -ovc copy -nosound -o <outputnosound.avi>
  • Then, I add a new audio file as the audio track to the video using the -audiofile option. For example, if I now want to add an .mp3 audio track named <newaudio.mp3>, I would use the command:
mencoder <outputnosound.avi> -ovc copy -oac mp3lame -audiofile <newaudio.mp3> -o <output.avi>

MKV files

  • To manipulate .MKV files directly, install the mkvtoolnix utilities:
sudo apt-get install mkvtoolnix mkvtoolnix-gui
This toolset includes the mkvextract and mkvmerge tools. Instructions for mkvextract can be found from the command-line terminal (man mkvextract) or here.

Extract .MKV audio track

  • Use mkvmerge to identify the tracks:
mkvmerge --identify <input.mkv>

This command will also list the format of the audio track (AC3, MP3, AAC, etc.)

  • If the audio track to be extracted is track 2, use
mkvextract tracks <input.mkv> 2:<output.ac3>
  • Use an audio editor such as Audacity to edit or modify the audio track as desired (and export it to the desired audio format).

Extract .MKV subtitle file to .SRT subtitle file

  • Use mkvmerge to identify the tracks:
mkvmerge --identify <input.mkv>
  • If the subtitle file to be extracted is track 3, use
mkvextract tracks <input.mkv> 3:<output.srt>
For this to work, of course, the MKV subtitle track must already be in text (.srt) format, not image (.sub/.idx) format.
  • If instead of the text-based .srt format the subtitle track of the input.mkv video is in the image-based vobsub format used with .vob commercial DVDs, the mkvextract tool will output the subtitles as a pair of output.sub and output.idx files instead. The .sub/.idx subtitle files can then be converted into a .srt subtitle file using VobSub2SRT.
  • Edit the .srt subtitle file for errors or unnecessary information (use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu):
kate <output.srt>

Remove .MKV subtitles and convert to AVI (XVID/MP3)

Mastroska container (.MKV) video files can have multiple subtitles included. In the default conversion from an .MKV container format to an .AVI container format, the default subtitle file of the .MKV container is automatically hardcoded into the converted .AVI file, which may be undesirable. To overcome this behaviour (so that the converted .AVI has no subtitles), use the -sid 999 option:

mencoder <input.mkv> -sid 999 -ovc xvid -oac mp3lame -lameopts cbr:br=192 -xvidencopts pass=1 -o /dev/null
mencoder <input.mkv> -sid 999 -ovc xvid -oac mp3lame -lameopts cbr:br=192 -xvidencopts pass=2:bitrate=-1200000 -o <outputnosub.avi>
  • To hardcode one of the subtitle tracks onto the .AVI video from the .MKV video, choose the subtrack ID, such as -sid 0 or -sid 1.
  • If using NTFS and the error
> Too many audio packets in the buffer: (4096 in 837540 bytes).
> Maybe you are playing a non-interleaved stream/file or the codec
> failed? For AVI files, try to force non-interleaved mode with the
> -ni option.

appears, then add these options:

-mc 0 -ofps 24000/1001 -noskip
  • Of course, a new .srt subtitle file could then be added to the resulting .AVI file. See this section.

FFMPEG

FFMPEG is the swiss-army knife of video and audio format conversion. It succeeds when no other program can. It is free and open source. If it not yet installed on your system as part of another package (it is used by many video/audio editors), then install it:

sudo apt-get install ffmpeg
  • A recent .deb package can also be found from the Debian wheezy site for ffmpeg found here. Choose the correct package for your system (32-bit i386 or 64-bit amd64).

Flash video (.flv) to MPG-2 using FFMPEG

  • To convert a saved Flash video (.flv) to an MPEG-2 format playable on a DVD, convert:
ffmpeg -i samplevideo.flv -target ntsc-dvd samplevideo.mpg
  • Then use K3b (or Gnomebaker) to write the mpg file to a New DVD Data Project.
  • For PAL use -target pal-dvd. For widescreen, use -target film-dvd. For other conversion tips, see this forum. (Note: Most Flash video has very low resolution, with a screen size of 360x270, for example. You may see a slight diminishment in resolution if you wish to convert it to 720x480 (which is the NTSC standard size) or other screen size. You can keep the original screen size and resolution by omitting the -target parameter.) If your original file is 16:9 widescreen and you desire a 4:3 letterbox output for playing on an overscanned TV, you may need to pad the file so that the widescreen is not compressed (see this forum):
ffmpeg -i samplevideo.flv -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58 samplevideo.mpg
  • You can also use the WinFF GUI and add the command (as above) as a "Preset," for subsequent use. For example:
Video converter (WinFF) -> Edit -> Presets ->
Preset Name: Letterbox -> Preset Label: 16:9 Widescreen to 4:3 Letterbox
Preset command: -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58
Ouput file extension: mpg -> Category: DVD
-> Add/Update -> Save
  • To convert to MPEG-4 (mp4) files, use
ffmpeg -i samplevideo.flv outputvideo.mp4
  • FFMPEG requires that multiple restricted extra codecs be installed. This can be done in a single easy step from the command-line Terminal:
sudo apt-get install kubuntu-restricted-extras
or
sudo apt-get install ubuntu-restricted-extras

Convert to .MP3 audio file using FFMPEG

Convert Flash video audio to mp3

  • Once you have downloaded flash video content (.flv) from the Internet (using the Video Download Helper plug-in for Firefox, for example), the audio component can be converted to an mp3 using this command (from the command line Terminal). (This will work for any type of video file, not just Flash.)
ffmpeg -i nameofvideoclip.flv -ab 160k -ac 2 -ar 44100 -vn nameoffile.mp3
where -i indicates the input, -ab indicates the bit rate (in this example 160kb/sec), -vn means no video ouput, -ac 2 means 2 channels, -ar 44100 indicates the sampling frequency. See FFMPEG docs for more info.

If I only want a segment of the video to be converted, I can use the time markers:

ffmpeg -i nameofvideoclip.flv -ss 00:00:09 -t 00:03:00 -ab 160k -ac 2 -ar 44100 -vn nameoffile.mp3
where -ss 00:00:09 indicates the point in the video (hh:mm:ss) at which to start conversion and -t 00:03:00 indicates the amount of time (from the start point) to convert.
  • As long as FFMPEG is already installed, the Video DownloadHelper plug-in for Firefox already has an option to automatically convert an online video (such as those found at YouTube) into an .MP3 file. (Settings are adjustable.) From the DownloadHelper icon in Firefox, highlight the video to convert, then
DownloadHelper icon -> Download and Convert -> Converter options: MP3

Edit/convert screencapture with FFMPEG

Note: This section under construction.

  • Note: I now recommend using mencoder for all video conversion techniques. It uses some of the ffmpeg libraries but is faster and gives more reliable and high-quality results.
  • This is only one example of a wide variety of techniques. Once I have a captured video, I want to convert it to XVID video (which is the format my older DVD player accepts) and MP3 audio (mp3lame), which I will place in an AVI container (which my DVD player also accepts).
ffmpeg -i Punchcast1.avi -vcodec mpeg4 -vtag xvid -acodec libmp3lame -ss 00:00:09 -t 00:03:00 Punchcast2.avi

I will start conversion (-ss) at second 9 (to eliminate unimportant things at the beginning) and convert 3 minutes (-t) of video (00:03:00).

  • I happen to watch my screencasts on my old-fashioned 4:3 television. To do that, I make a letterboxed video:
ffmpeg -i Punchcast1.avi -vcodec mpeg4 -vtag xvid -ss 00:00:09 -t 00:03:00 -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58 -acodec libmp3lame Punchcast3.avi

My laptop screen is 1366x768, which I reduce to a size of 648x364. My TV wants 720x480, so I pad the sides and top/bottom. Why not a width of 720 initially? My older television has 10% overscan, which cuts off 10% of the video. I therefore use (at least) 10% padding on the edges.

In newer versions of FFMPEG, the padding (and many other) options have changed. The proper command is now:

ffmpeg -i Punchcast1.avi -vcodec mpeg4 -vtag xvid -ss 00:00:09 -t 00:03:00 -s 648x364 -vf pad 720:480:36:58 -acodec libmp3lame Punchcast3.avi
ffmpeg movie=Punchcast1.avi:seek_point=9 -vcodec copy -acodec libmp3lame Punchcast1f.avi

WinFF (FFMPEG GUI)

WinFF is a free, GPL-licensed open source GUI frontend for FFMPEG. Install:

sudo apt-get install winff xterm

Run:

Menu -> Applications -> Sound & Video -> WinFF

Avidemux (Video editor/convertor GUI)

I happen to like the command line for video conversion (because the commands are more transparent), but many users prefer a GUI interface, for which Avidemux has long been a favourite.

Split a file into segments

Any file can be split into segments using the Linux command:

split -b 1440k my_big_file

which will split my_big_file into equal segments of size 1440 kb.

Join .MPG video segments

Individual video segments (MPEG-2, for example) can easily be joined:

cat samplevideo1.mpg samplevideo2.mpg samplevideo3.mpg > samplevideo123.mpg
You can then write the resulting MPEG-2 file to a DVD and play it in most DVD players.

VobSub2SRT (Convert subtitles from .sub/.idx to .srt)

  • VobSub2SRT is a simple (GPLv3-licensed) command-line program to convert the image-based .idx / .sub subtitle files (used with the .vob format found on commercial DVDs) into text-based .srt text subtitle files by using OCR. It is based on code from the MPlayer project, Tesseract as OCR software, and libavutil (part of the FFmpeg project). Install the (K)Ubuntu/Debian (.deb) package from a PPA repository:
sudo add-apt-repository ppa:ruediger-c-plusplus/vobsub2srt
sudo apt-get update
sudo apt-get install vobsub2srt
  • Alternatively, you can download and build a version from source code.
  • Install dependencies:
sudo apt-get install pkg-config build-essential cmake libavutil-dev libtesseract-dev
  • For (K)Ubuntu 12.10 (Quantal) also install:
sudo apt-get install libtiff5-dev tesseract-ocr-eng
  • For (K)Ubuntu 12.04LTS (Precise) also install:
sudo apt-get install libtiff4-dev tesseract-ocr tesseract-ocr-eng   
  • If you will be converting subtitles in languages other than English, you must install tesseract for any or all of those languages as well:
sudo apt-get install tesseract-ocr-vie tesseract-ocr-deu tesseract-ocr-fra tesseract-ocr-ita
sudo apt-get install tesseract-ocr-nld tesseract-ocr-spa tesseract-ocr-por tesseract-ocr-deu-f
where vie is for Vietnamese, deu is for German, fra is for French, ita is for Italian, nld is for Dutch, spa is for Spanish, por is for Portugeuse, and deu-f is for German Fraktur script. If you don't you will get an error of the type: Unable to load unicharset file /usr/share/tesseract-ocr/tessdata/xxx.unicharset.
  • Download and unzip the VobSub2SRT .zip file into its own directory:
mkdir vobsub2srt
cd vobsub2srt
wget -O vobsub2srt-current.zip https://github.com/ruediger/VobSub2SRT/zipball/ca53a18108eb08d6e2b853643d8c6838e2489823
unzip vobsub2srt-current.zip
rm vobsub2srt-current.zip
  • This will create a subdirectory with the current version. For example, my version is vobsub2srt/ruediger-VobSub2SRT-ca53a18. Change into that directory then compile and install the program.
cd ruediger-VobSub2SRT-ca53a18
./configure
make
sudo make install
  • This should install the program vobsub2srt to /usr/local/bin. You can uninstall vobsub2srt with sudo make uninstall. You can build a *.deb package (Debian/Ubuntu) with make package. The package is created in the build directory.
  • Convert the .sub / .idx pair of subtitle files (named Filename.sub and Filename.idx) into a .srt subtitle file (named Filename.srt):
vobsub2srt Filename
where Filename is the file name of the subtitle files WITHOUT the extension (.sub / .idx).
  • If there are multiple languages in the .sub / .idx pair of subtitle files, you can select which language to convert (using the 2-letter ISO 639-1 language code, e.g. en, fr, de, it, es, pt, etc.):
vobsub2srt --lang en Filename 
  • Edit the .srt subtitle file for OCR mistakes (use the gedit text editor instead of kate if using Ubuntu instead of Kubuntu):
kate Filename.srt

Create a commercial (.vob) format DVD

  • The audiovideo container of commercial DVDs uses the .vob format. This container requires either MPEG-1 or MPEG-2 video (.mpg) and either AC3 or MPEG-2 (.mp2) audio. Therefore, the first step in creating a DVD-video in this format is to convert all audiovisual files (to be included on it) to .mpg files (with one of those video and audio formats), usually with the MPEG-PS (A+V) container. This can be done from the command-line terminal (using mencoder or ffmpeg) or from a GUI utility (such as Avidemux).
  • The GUI utility Avidemux is a GUI utility that has standardised settings for file conversion. Here is the Avidemux tutorial for conversion to a DVD-video.
  • Open the file and allow the time map and Index to be rebuilt.
  • It is best to convert a file (to be included on the DVD) to a format with MPEG-2 (avcodec) video, AC3 (lav) audio, and the MPEG-PS (A+V) container as an intermediate first. The MP2 audio format (the default for Avidemux in "Auto" mode) can also be used, and will result in a much smaller .mpg file than when using AC3 audio, but several of my very old DVD players only recognise AC3 audio (so this has therefore become my personal preference).
  • The easiest method for doing this is to use the Avidemux Auto DVD wizard. (Avidemux -> Auto -> Optical Disc -> DVD). Select the appropriate souce and destination ratios. (My source videos are usually already in 16:9 widescreen formats, and I want to make DVDs for my widescreen 16:9 TV. I therefore choose 16:9 for both the "Source Aspect Ratio" and the "Destination Aspect Ratio.") The Auto DVD Wizard uses MP2 audio by default, but I personally like AC3 audio instead (the format usually used on "commercial" DVDs). I therefore change this using the Audio -> AC3 (lav) option.
  • It is possible to customise (or initially set) the format options manually as well (see the Avidemux documentation). Select the Video (and make sure the aspect ratio is the one you desire in Video -> Configure -> Configuration: DVD -> Aspect Ratio: 16:9 ), Audio, and (container) Format options.
  • To be DVD compliant, the resolution must be
  • 720*480 or 704*480 or 352*480 for NTSC
  • 720*576 or 704*576 or 352*576 for PAL/SECAM
This is set automatically if using the Auto DVD wizard. If your original video does not already have the correct aspect ratio, you will have to use cropping, scaling, and/or black bar "Filter" options until one of the standard resolutions is achieved.
  • Save the file ( Avidemux -> File -> Save -> Save Video... -> myconvertedvideo.mpg ) to activate the conversion process. (If prompted whether to "Reuse the existing log file?" answer "No.")
  • Alternatively, FFMPEG can be used from the command-line to convert a file to the .mpg format. A simplified preset option for for conversion to both PAL and NTSC options is available.
  • Once all files to be included on the DVD-video have been converted to .mpg files, the utility dvdauthor can be used for conversion to .vob format (appropriate for writing to the DVD). While this utility can be used from the command-line, "authoring" (conversion) is more easily accomplished using one of several available GUI front-ends, which allow creation of menus for the DVD as well.
  • With Kubuntu I use KMediaFactory for simple projects. (QDVDAuthor, which is difficult to install in recent Kubuntu versions, is superior and more powerful. KMediaFactory, in contrast, is in the repositories and is adequate (and quick) for most purposes.
  • Rename the .mpg files (created with Avidemux or other method) carefully. The filename(s) becomes the Title(s) used by KMediaFactory for the video(s) on the DVD menu.
  • Set up the DVD menu in KMediaFactory.
  • KMediaFactory -> Project -> Title -> MyDVDTitle (this will appear on the DVD Menu at the top)
  • -> Type: DVD-NTSC -> Aspect: 16:9 -> Destination Folder /home/user/DVDs
  • Add the .mpg files to the DVD.
  • KMediaFactory -> Media -> Add Video -> MyFirstVideofile.mpg -> VideoProperties: Aspect ratio: 16:9
  • -> Add Video -> MySecondVideofile.mpg -> VideoProperties: Aspect ratio: 16:9
  • Choose the DVD Menu appearance.
  • KMediaFactory -> Template -> Preview 3
  • Choose the output format. For this, I generally create a "DVD folder":
  • KMediaFactory -> Output -> DVD Folder
  • Start the conversion ("DVD authoring") process. If an error appears, the problem usually lies in a non-existent (or write-protected) folder having been specified when setting the "Title" options. Make sure the folder has been specified properly. KMediaFactory will then create the standard AUDIO_TS and VIDEO_TS folders in the folder specified.
  • -> Start
  • Prior to burning I check to make sure that my DVD looks the way I had intended using VLC (VLC -> Media -> Open Disc... -> Browse... -> specified_folder -> Play)
  • In Kubuntu I then use K3b to burn the AUDIO_TS and VIDEO_TS folders to a blank DVD. This can be done in K3b using the "New Video DVD Project" (K3b -> More actions... -> New Video DVD Project) using the AUDIO_TS and VIDEO_TS folders as the data. Edit the name of the DVD to reflect the desired DVD name. "Burn" the DVD. The result will be identical to commercial DVDs. (Note: In recent versions of K3b I have had to "Burn" using the "growisofs" Writing app at 8x Speed and DAO (Disc-At-Once) Writing Mode in order to achieve reliable burns. See here for more details.)

Recommended formats

  • There is only one format that works on all my devices (computer (both Linux and Windows), (Android) tablet, (Android) eBook reader, MP3 player, (older) DVD player):
  • .AVI container with XVID/DivX video codec and MP3lame (MP3) audio codec
I use this for all my devices, and encode video files to about 700 MB. This is a good size that gives good quality and allows me to fit many videos on a single SDcard (which I use in my mobile devices). For most of my devices, a 128 kb MP3 encoding bitrate is sufficient; I previously encoded at 192 kb for MP3lame (which is the default bitrate for AC3 sound), but I find this bitrate to be unnecessary. (The higher the encoding bitrate, the larger the encoded file, and I try to keep all my files around 700 MB.) The .AVI container has several limitations: it does not allow more than stereo audio (i.e. no 5.1 surround sound), does not allow multiple subtitle files, and requires a constant bitrate (CBR) audio channel. For advanced archival purposes it may not be suitable in the long-term, but currently it is desirable for the wide range of devices that accept it. It is also one of the only containers guaranteed to be accepted by Windows computers (since the container is originally a Windows-based format).
  • I am also able to use an .MP4 container with X264/H.264 video codec and either the AAC audio codec or the MP3lame (MP3) audio codec on many devices, but not all. Neither the X264/H.264 video nor the AAC audio will play on my (older) DVD player or MP3 player, for example (though it plays on my computer and some newer Android tablet devices). Furthermore, the rewind/forward/seek function for .MP4 files does not work accurately on many of the devices that do play it.
  • The related .M4V container (the proprietary Apple Quicktime format) works on almost none of my devices, and, furthermore, is difficult to decode and re-encode to a different container. I shun this format like the plague.
  • The newer .MKV container, though open source and a superior container, is accepted by very few of my older devices. It does not play on my (older) DVD player or MP3 player, for example (no matter which video and audio codecs are used).
Nevertheless, most newer DVD players seem to accept the .MKV format. In fact, it is now difficult to find DVD players that will still play .AVI with XVID / DivX video. Over the years, however, I have accumulated a very large collection of .AVI / XVID / MP3 videos. In 2013, there were only a limited number of DVD players that advertised DivX and .AVI compatibility that I could find (including some Philips players) that would play them all. Check compatibility charts for players carefully if you find yourself with a large collection of .AVI / XVID video files.
  • My Android (2.3) tablet devices will also not accept the AC3 audio codec (which is the standard audio used on commercial DVDs, for example), so most of the time I re-encode any files having AC3 audio with the MP3lame audio codec instead.

EBook Conversion

Calibre (eBook conversion)

Calibre is an eBook reader, library manager, and tool for conversion between many eBook formats (including the .epub format). Install:

sudo apt-get install calibre

Convert a web page to ePub format

The ePub (.epub) format is the default format for many eBook readers. Its format is closely similar to HTML, CSS, and XML formatting of many web pages and, therefore, ePub conversion is, in fact, most successful from HTML documents.

  • Save a complete webpage in .htm format:
Firefox -> File -> Save Page As... -> Filter: Web page, complete -> webpage.htm
  • Edit the .htm file (using kate in Kubuntu or gedit in Ubuntu) and delete any elements of the page that you do not wish to be included in the eBook.
  • Start Calibre and add the downloaded/edited .htm file as a book to the Calibre library:
Calibre -> Add Books... -> webpage.htm
  • Convert the downloaded/edited .htm file:
Calibre -> (highlight webpage.htm) -> Convert E-books -> Convert individually

Choose your conversion options.

  • Calibre is able to convert into .mobi format and many other eBook formats as well (in a similar manner).

Create an eBook cover

Calibre allows the addition of a cover to an eBook. In general, a 525x700 px JPEG (.jpg) image is easiest to use as a cover. I superimpose a 525x700 px cover image on a plain 590x750 px background in order to accommodate more eBook reader screens, but that is a personal preference.

  • Using Gimp, create a new image that is 590x750:
Gimp -> New... -> Image Size: 590x750
  • Then import the 525x700 image as a new