2.3.2. Package management#
When you were looking through the menus before, you saw that by default, Ubuntu comes with a single application for all the common tasks you can do. How very much unlike the free software spirit! Of course, a great many applications are available for each task, but the Ubuntu people have selected only a small subset suitable for regular users.
All other software can be installed using the package manager. The package manager can be instructed to install software via command line tools, but Ubuntu also provides a graphical interface to find and install common desktop software packages with its package manager. Nowadays, this is called App Center, and its icon should be present in the Ubuntu dock on the left by default.
Note, older versions of Ubuntu may ship with a similar application called Ubuntu Software instead of App Centre.
Exercise 2.5
The default Ubuntu installation comes with the Firefox web browser installed by default.
Use Ubuntuâs App Center (you can find it in the Dock or using the Apps button) to find out which other web browsers you can install.
You can search for browser in the App Center.
A package contains all the files that belong to a specific piece of software. But remember that people like to build on each otherâs work. To avoid having to install many copies of the same basic library, it comes in its own package, on which the other packages depend. Thus, when you install an application, the package manager not only downloads and installs that applicationâs package, but also all its dependencies (and their dependencies, etc.).
App Centre hides all this complexity. We can use another graphical package manager, called Synaptic, which hides less, so itâs easier to see whatâs going on.
Exercise 2.6
Use App Centre to search for a small GUI game called Synaptic Package Manager.
Note that it is an older piece of software, and you may get some warnings that it has not been verified.
What happens when you click the Install button, once you found it?
It installs it immediately.
You are redirected to the Synaptic website, where you can download an executable installer.
You have to Authenticate first, with your password, before you can install the software.
You can install it after watching an ad, which is used to support the open-source development.
Exercise 2.7
Start the Synaptic Package Manager, and use it to find out more about its own package.
(hint: once you started Synaptic, use its own search tool to search for synaptic.
Find that exact package in the results (there can be multiple results, showing other packages), select it, and then click the Properties bottom.
In the pop-up window, you can find exactly which
libraries it depends on, and which files are installed, etc.
Note
Most of the time, if we will ask you to install some software on your Ubuntu Linux system,
we will not ask you to use App Centre, but we will use the package manager directly via
a command line tool called apt.
For example, to install a tool like cowsay, you would open a terminal and type a command like
$ sudo apt install cowsay
After entering your password, this will install the cowsay software.
You can then immediately use the software
(this particular silly piece of software will display a cow in your terminal that will repeat your text, e.g. cowsay hi).
You will learn more about using terminals and shell commands in Section 2.4.
2.3.2.1. Repositories and PPAs#
All software that you can install using the package manager is downloaded from online distribution shares called repositories. A repository is essentially nothing more than a collection of files (called Debians in Debian Linux and Ubuntu), organized in a certain way that the package manager understands. The USB stick you can use to install Ubuntu from in Section 2.11.2.2 is in fact a bootable repository of sorts[1]. Whenever you install something with Ubuntu Software or through synaptic, the package manager uses its information on all available packages (something called the index), downloads the necessary files and installs them.
Although it may seem like the App Centre contains all the software that is available for us to install, this is not true: it is fairly easy to add additional repositories to the list accessed by the package manager, allowing us to install software that is not available otherwise.
Exercise 2.8
Ubuntu itself comes with a default list of repositories it uses, but some are disabled. Open synaptic, then use Repositories under Settings to enable the Universe repository. Now switch to the Other software tab and scroll through the list.
Do you recognize the installation medium you used? Which repositories are on there?
Close the dialogue using the Close button, and acknowledge the fact that the package manager now needs to reload its index, in order to update its local knowledge of available packages.
Software repositories may not only be managed by big companies or organisations. Ubuntu enthusiasts can create what are called Personal Package Archives, or PPAs. These mini repositories may contain anything from completely new software written by someone in their spare time, to updates to Ubuntu that Canonical (the company behind Ubuntu) wonât release. Adding a PPA is as simple as adding any other repository, and can be done through either the command line, or the GUI of synaptic[2].