Skip to content

Software Repositories#

Let's talk about package repositories first. I want you to better understand where software is coming from when you install it.

The below diagram shows three networks: your network, with your servers in insides it; a network owned by the creators and maintainers of Ubuntu, "Canonical"; and a third party vendor's network.

Software Repositories

Software Repositories

The Canonical and vendor's networks have "apt repositories" inside of them. These repositories contain software that you can install on your local system, provided it's configured to use a remote repository. With Ubuntu, you get the Canonical repositories configured on your server automatically. You don't have to do any work there.

For a third-party vendor, you'll have to add their repository to your system before you can add packages from their repository to your local systems. We'll look at that later.

Our Default Repositories#

Let's look at what our Ubuntu server comes with by default, in terms of repositories (I'm running this has superman, you can use your original user or superman, it's upto you):

superman@develop:~$ grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
/etc/apt/sources.list:deb focal main restricted
/etc/apt/sources.list:deb focal-updates main restricted
/etc/apt/sources.list:deb focal universe
/etc/apt/sources.list:deb focal-updates universe
/etc/apt/sources.list:deb focal multiverse
/etc/apt/sources.list:deb focal-updates multiverse
/etc/apt/sources.list:deb focal-backports main restricted universe multiverse
/etc/apt/sources.list:deb focal-security main restricted
/etc/apt/sources.list:deb focal-security universe
/etc/apt/sources.list:deb focal-security multiverse


You should Google for the grep command and learn how-to use it. It's very powerful. I won't go into detail on it here now, but future updates to the book will include useful tools like grep. All you need to know today is it's searching inside the file for the patterns we've given it - *.list and ^deb - and then printing the lines (in full) that it finds match those patterns.

I see ten repositories in total. Let's break down a line from the file:

/etc/apt/sources.list:deb focal main restricted

This breaks down into this.


This is added to the output by grep and isn't actually inside the file. It's grep's way of telling us where it found the pattern.


This is the repository type. A deb file is a Debian software package. Debian is another Linux distribution, and the distribution that Ubuntu was original based off of.

A software package contains all the files, scripts, and more, that are needed to install a specific piece of software. Software can be quite complex and require a lot of files to operate.

This is the remote location of the repository. You can see it's located on the domain. This address is essentially where the apt tools (we'll cover these later) go to find packages, download them, and install them.

focal main restricted#

The focal part if the version of Ubuntu we're running - the "distribution". It's called "Focal". Ubuntu releases (distributions) are given names, and we're running the Focal release.

The keywords main and restricted are the repositories we want to access and pull packages from. There are four primary repositories Ubuntu uses:

  1. main - Canonical-supported free and open-source software.
  2. universe - Community-maintained free and open-source software.
  3. restricted - Proprietary drivers for devices.
  4. multiverse - Software restricted by copyright or legal issues.

There are others, too. We won't go over them all.