Inspect apt sources with cat /etc/apt/sources.list
In this step, you'll explore where your system gets its software packages from. When you used sudo apt update
and sudo apt install htop
in the previous lab, apt
needed to know which servers to download the software from. This information is stored in configuration files.
The primary file that lists the sources for apt
is /etc/apt/sources.list
. We can use the cat
command again to view its contents.
Type the following command in your terminal and press Enter:
cat /etc/apt/sources.list
You will see lines starting with deb
or deb-src
. These lines specify the repositories (servers) where apt
looks for packages.
## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
## newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
## deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted
### Major bug fix updates produced after the final release of the
### distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
## deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
### N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
### team. Also, please note that software in universe WILL NOT receive any
### review or updates from Canonical except for security updates. The
### responsibility for security updates from this repository rests entirely
### with the community.
deb http://archive.ubuntu.com/ubuntu/ jammy universe
## deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
... (output may vary)
Each deb
line typically follows this format:
deb [options] uri distribution [component1] [component2] [...]
deb
: Indicates a binary package repository.
uri
: The address of the repository (e.g., http://archive.ubuntu.com/ubuntu/
).
distribution
: The distribution codename (e.g., jammy
).
components
: Categories of software (e.g., main
, restricted
, universe
, multiverse
).
Lines starting with #
are comments and are ignored by apt
.
Understanding sources.list
is important if you ever need to add third-party repositories to install software not available in the default sources.
Click Continue to complete this step.