Linux for Developers Course
Linux for Developers
/
Beginner

APT (Advanced Package Tool)

Definition

The primary package manager used by Debian-based Linux distributions (like Ubuntu and Mint). It handles installing, updating, and removing software and automatically resolves dependencies.

Explain Like I'm New

The App Store for Ubuntu. If you want a program, you don't go to a website to download an `.exe` file. You ask `apt` to find it, download it, and install it automatically.

Real World Example

You want to install Python. You type `sudo apt update` to refresh the store's catalog, then type `sudo apt install python3`. It automatically downloads Python and the 15 invisible libraries Python needs to function.

Common Use Cases

  • •Installing software on Ubuntu/Debian
  • •Applying system security updates

Interview Questions

basic

  • What command do you run to upgrade all installed software on your Ubuntu system to the latest versions?

intermediate

  • Why do you almost always have to run `apt update` BEFORE you run `apt install`?

Flash Cards

Question

Upgrade command?

Click to reveal answer
Answer

`sudo apt upgrade`

Question

Why update first?

Click to reveal answer
Answer

`apt update` doesn't actually update your software. It updates the *catalog index* of what software exists in the world. If you don't update the catalog, `apt install` might try to download a version of a package that was deleted from the internet years ago.