Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · packages & software

apt

install software on Debian and Ubuntu

apt is the package manager for Debian-family systems. It downloads a program and everything it depends on from the distribution’s repositories, and later updates the whole system with two commands.

apt update refreshes the list of what is available; apt upgrade installs the newer versions.

Refresh list
apt update
downloads no software
Upgrade all
apt upgrade
installs newer versions
Install
apt install NAME
with its dependencies
Needs root
For changes
searching does not

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

root@netflow — bashapt
# apt update
1Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Fetched 126 kB in 1s (118 kB/s)
212 packages can be upgraded. Run 'apt list --upgradable' to see them.
3# apt install tree
The following NEW packages will be installed:
tree
40 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 47.1 kB of archives.
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
Checking each repository

Hit means the list has not changed; Get means a newer one was downloaded. No software is installed by this step.

2
What is out of date

Twelve installed packages have newer versions. "apt upgrade" would install them.

3
Installing a package

apt works out what else is needed and lists everything it will do before doing it.

4
The summary

One new package, nothing removed. Larger changes ask for confirmation at this point.

Switches

A switch changes how the command behaves. These are the ones used day to day; man apt lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-y
Answer yes to prompts. For scripts.
--no-install-recommends
Install only the hard dependencies, not the suggested extras.
-s
Simulate: show what would happen, change nothing.
--purge
With remove, also delete the package’s configuration files.
--reinstall
With install, install the package again over itself.
-f
Fix broken dependencies.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

sudo apt update && sudo apt upgrade

The routine update: refresh the list, then install what is newer.

apt search "packet capture"

Searches package names and descriptions.

apt show nginx

Shows a package’s version, size, dependencies and description.

sudo apt autoremove

Removes packages that were installed as dependencies and are no longer needed.

In cybersecurity

Updating is the single most effective security task on a Linux machine.

Most break-ins use known flaws

The fix usually existed before the attack. Regular "apt update && apt upgrade", or unattended-upgrades, closes those doors.

Packages are signed

apt verifies every repository’s signature. A warning about an unsigned or changed repository should stop you, not be clicked through.

Third-party repositories

Adding a repository gives its owner the power to install software as root on your machine at every update. Add as few as you can.

Protocols it shows

HTTPTLS

Read alongside