Mission 22 of 30

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.

40–50 min Week 3 · Productivity, storage, packages, networking Ubuntu terminal
Your outcome: APT feels understandable, and you know when a command changes the real system.
Practice inside ~/linux-practice. Check your setup before you begin. Prerequisite: Disk Usage and Storage Info .

What you’ll practice

  • Search packages
  • Inspect installed packages
  • Recognize install/remove as system-changing

The mental model

  • 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.

Try it in your terminal

Read-only package search

Read-only system view

Searches and inspects packages without installing anything.

Run from ~/linux-practice

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

Detect your package manager

Read-only system view

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

Run from anywhere

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

Inspect installed files

Read-only system view

Uses dpkg to inspect installed package information.

Run from ~/linux-practice

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

Optional install/remove pattern

Optional admin

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

Run from advanced users only

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

Put it into practice

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

Check your result

Package inspection succeeds without an admin change.

Common mistakes

  • You install a package with `sudo apt install`, then delete ~/linux-practice thinking that undoes it. Package installation writes to system directories like /usr and /etc. Deleting your practice folder does not remove installed software.
  • You type `sudo apt search` when `apt search` works fine. Read-only commands don't need sudo. Save sudo for commands that actually change the system — install, remove, update.

Check your understanding

Explain these in your own words. If you’re unsure, revisit the examples before moving on.

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

Your practice, your pace

Loading saved progress…

Discussion

Continue the conversation about this guide. Loading comments connects to GitHub Discussions through giscus.

Open community discussions on GitHub

Check before you copy

This command needs care. Read its context, confirm the target and location, and keep a recovery path.

Copying does not run a command.