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 that is not available in the Ubuntu archives. If this happens, you can also download and install files from websites.

[Caution]

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), RPM Package Manager files (.rpm files), and Tarballs (.tar files).

This section deals with installing these single files.

[Warning]

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 Chapter 2, Administrative Tasks).

To install a .deb file, double-click on it. If you prefer using the Terminal, enter:

sudo dpkg -i package_file.deb

To uninstall a .deb file, deselect it in your package manager. Or from a Terminal, enter:

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.

In a terminal, enter:

sudo alien package_file.rpm

If you get a “command not found” or similar error, install alien before trying again:

sudo apt-get install alien

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”).