Installing a Single Package File

The preferred method of installing programs is via the package managers described in this chapter. However, although the Ubuntu package archives are very large, it is possible that you may wish to install a package which is not available in the Ubuntu archives. If this happens, you can also download and install files from websites.


It is important to ensure that any files you download come from a safe source before installing them.

There are many different kinds of Linux package files. Most of these are associated with the package managers of specific Linux distributions. Examples are Debian Package files (.deb files), Redhat Package Manager files (.rpm files), and Tarballs (.tar files).

This section deals with installing these single files.


It is not guaranteed that these files will be compatible with your system and you will not receive security updates if you install these files. For these reasons, if you wish to install a program, always use a native Ubuntu package of the application available through a package manager, if there is one available.

Install/uninstall .deb files

These files are Debian packages. The package files associated with Ubuntu have the .deb suffix because of Ubuntu's close relations with the Debian GNU/Linux distribution. You will need administrative privileges to install a .deb file (see the section called “Root And Sudo”).

  1. To install a .deb file, simply double click on it, and then select Install Package

  2. Alternatively, you can also install a .deb file by opening a terminal and typing:

    sudo dpkg -i package_file.deb

  3. To uninstall a .deb file, deselect it in your package manager, or type:

    sudo dpkg -r package_name

Convert .rpm files to .deb files

Another type of package files is Red Hat Package Manager files which have the .rpm suffix. It is not recommended to install these on an Ubuntu system. In almost all cases, a native Ubuntu .deb package is available. However, if absolutely necessary, an .rpm file can be converted to a .deb package using the program alien.

  1. Install the alien program (Chapter 2, Adding, Removing and Updating Applications).

  2. Run the following command in a terminal, with administrative privileges:

    sudo alien package_file.rpm

Install tarballs

Files with the .tar.gz or .tar.bz2 suffix are package files known as tarballs which are widely used in Linux and Unix.

If there is no native Ubuntu package available in any of the Ubuntu repositories, you can use the command line to install or uninstall the Tarball file by following the instructions that come with the package.

Tarballs often contain the source code of the program, and need to be compiled in order to be used. To do this, extra software will generally be needed (see the section called “Basic Compilers”).