InstallingSoftware

Revision 7 as of 2006-04-23 20:49:18

Clear message

Info <!> Work in progress

Introduction

By default, many useful programs are installed when you put Ubuntu onto your computer. However, from time to time you may need to perform a task that the default set of applications cannot manage, and so will require some new software. Or you might just want to try out a alternative program to one which is already installed. Installing software in Ubuntu is easy, and this guide will show you how to do it.

If you'd like to get some background information on what's happening when you install software (which may be a little technical in places), read Packages and Package Management. If you just want to get started installing new programs, you can skip straight to Installing a Package.

Packages and Package Management

What is a package?

Software is a very broad term, and is generally taken to mean a program which you can run on your computer. However, such programs often need other resources to help them accomplish their tasks. When you install software, thousands of files might be required just to let the program start! When you think that they all have to be put into exactly the right location, and some of those files might need to be changed depending on what type of computer you have, it all gets very complicated. But you don't have to worry about this - Ubuntu has a way of handling all this complexity.

Ubuntu uses packages to store everything that a particular program needs to run. Packages are collections of files bundled into a single file, which can be handled much more easily. As well as the files required for the program to run, there will be special files called installation scripts, which copy the files to where they are needed amongst other things.

Source or Binary?

Normally, when someone makes a package for a program, they put all of the source code for the program into that package. Source code is written by programmers and is essentially a list of instructions to a computer which humans are able to read and write. Computers can only understand this code if it is interpreted for them into a form that they can use directly. One such way of interpreting source code for a computer is by compiling it into binary, which computers are able to understand.

So why don't the people who make the package (called packagers) just convert it into binary straight away? Well, different computers use different types of binary, so if you make a binary package for one type (like an Intel PC), it won't work on another (like an Apple Macintosh).

Source packages are simply packages which just include source code, and can generally be used on any type of machine if the code is compiled in the right way. Binary packages are ones which have been made specifically for one type of computer, or architecture. Ubuntu supports the x86 (i386 or i686), AMD64 and PPC architectures - to find out which one you are using, open Applications | Accessories | Terminal, type arch then hit the enter key. The correct binary packages will be used automatically, so you don't have to worry about picking the right ones.

Package Managers

A package manager is an application which handles the downloading and installation of packages. Ubuntu includes a few package managers by default, and which one you use depends on how advanced the package management tasks are that you want to achieve. Most people will only need to use the most basic package manager, the Add/Remove tool, which is very easy to use.

Repositories

Where can you get packages from? Ubuntu stores all of its packages in locations called repositories. A repository is simply a location which holds packages of similar types, which can be downloaded and installed using a package manager. A package manager will store an index of all of the packages available from a repository. Sometimes it will 're-build' this index to make sure that it is up to date and knows which packages have been upgraded or added into the repository since it last checked.

There are four Ubuntu repositories for each architecture - Main, Restricted, Universe and Multiverse. Each has a different purpose. By default, only packages from Main and Restricted can be installed. If you would like to be able to install packages from Universe or Multiverse, read the AddingRepositoriesHowto.

In addition to the official Ubuntu repositories, it is possible to use third party repositories. Be careful - some are not compatible with Ubuntu and using them may cause programs to stop working or may even cause serious damage to your installation. The page http://www.ubuntulinux.nl/source-o-matic can help you to find extra repositories, and the AddingRepositoriesHowto gives instructions on how to enable them.

Installing a Package

Add/Remove - the basic method

The easiest way of installing a package is to use the 'Add/Remove' tool. Click Applications | Add/Remove... to start it. First, find the package or packages you want to install. You can search for a keyword, such as 'email', or look through the categories shown on the left hand side of the window. Once you've found a package you want to install, tick the box next to its icon. You can do this for as many packages as you like.

Once you've finished choosing, click the Apply button at the bottom of the window. Another window will pop up, showing all of the packages you've selected and asking if you'd like to apply the changes. To install the packages, click Apply. You'll then be asked to type in your super-user/administrator password. Once you've entered it, another window will appear informing you of the installation progress. Once this has finished, click Close. Your new programs are installed, ready to use!

Synaptic - the more advanced method

The Synaptic Package Manager offers a more advanced way of installing packages. If you have problems finding a suitable package with the Add/Remove tool, try using the search in Synaptic. This searches all of the packages in the available repositories, even the ones which don't contain programs.

For details on using Synaptic, read the SynapticHowto.

Aptitude - the text-based method

Aptitude is a terminal-based package manager. Read AptitudeSurvivalGuide for more information on how to use Aptitude.

apt-get - the technical method

The apt-get program is a command-line package manager, which should be used if the Add/Remove tool and Synaptic ever run into problems. It provides an advanced interface to APT, the underlying package management system which Ubuntu uses, but is reasonably easy to operate if you ever have to use it. Power users may find that apt-get is quicker to use and more powerful than the graphical options above.