Suggested day 2220–30 minutesOptional admin

Mission 2 of 5

Ubuntu Package Management Safely

Discover whether software is installed before considering a system change.

Search and inspect packages while keeping installation optional so the course remains removable.

Outcome: APT feels understandable, and you know when a command changes the real system.

Mental model

Understand what is happening

APT manages Ubuntu software.

Ubuntu and Debian use apt; Fedora uses dnf, Arch uses pacman, and openSUSE uses zypper. File and shell commands in this course work across them, but package commands do not.

Search/show/list are read-only.

Install/remove/purge use sudo and affect the real system outside ~/linux-practice.

Guided lab

Work through the mission

1

Read-only package search

Read-only

Searches and inspects packages without installing anything.

Terminal
apt search 'text editor' | head -20
apt show nano | head -20
apt list --installed | head -20
2

Detect your package manager

Read-only

Checks which common package-manager command is available without changing the system. Follow the APT examples only on Ubuntu, Debian, or their WSL distributions.

Terminal
command -v apt || true
command -v dnf || true
command -v pacman || true
command -v zypper || true
3

Inspect installed files

Read-only

Uses dpkg to inspect installed package information.

Terminal
dpkg -l | head -20
dpkg -l | grep -i bash
dpkg -L bash | head -20
4

Optional install/remove pattern

Admin

This changes the real Ubuntu system. It is optional and not part of the removable sandbox guarantee.

Terminal
sudo apt update
sudo apt install sl -y
sudo apt remove sl

Checkpoint

Verify the mission

Package inspection succeeds without an admin change.

Try it yourself

One step without a recipe

Use apt search file manager and apt show nautilus without installing anything.

Need a hint?

Before you install anything, run `apt show package-name`. It tells you what the package does, how big it is, and what else it pulls in. If the dependency list is huge, reconsider.

Explain it back

Before you move on

  • Which APT actions are read-only?
  • Why is package installation optional in this guide?

Shortcuts:Alt + ← previous lessonAlt + → next lessonAlt + H home? focus search