Thuta Learning
AdvancedDevOps & Toolsbeginner

Package Management (apt)

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand Package Management (apt) without any of the intimidation
  • Get hands-on practice trying out the commands yourself in the terminal
  • See how these commands actually come in handy on a real server or project

Let's think about it this way for a second

A package manager is basically Linux's 'app store' — it manages installing, updating, and removing software from one central place. The Debian/Ubuntu family uses apt (Advanced Package Tool), the Fedora/RHEL family uses dnf, and the Arch family uses pacman — this tutorial focuses mainly on apt (as mentioned back in the chapter on choosing a distro). sudo apt update checks the server for an updated package list (whether new software is available) — 'update' here does NOT mean it updates your software, it just refreshes the list; this trips up a lot of beginners. It's sudo apt upgrade that actually updates your software to newer versions.

Let's connect this to a real-world scenario

When you want to install new software, run sudo apt update first (to keep the list fresh), then sudo apt install <package-name> — for example, sudo apt install htop or sudo apt install git. To uninstall software, type sudo apt remove <package-name>. Running apt search <keyword> shows every package matching that keyword — handy when you don't know the exact package name.

Let's try it together in the terminal

bash
sudo apt update
sudo apt upgrade
sudo apt install htop
sudo apt remove htop
apt search text-editor
You should see
After sudo apt install htop, the htop command can be run from anywhere in the terminal.

5-minute try-it

Run sudo apt update (you may be asked for your password). Then run apt search git and note down how many results show up.

A quick word of caution

Running sudo apt upgrade on a production server without testing it first can shift app dependency versions and break your app — having a scheduled upgrade window for your servers is a best practice.

Easy traps

  • Thinking running apt update means all your software has been updated — you still need apt upgrade too
  • Guessing at a package name, trying to install it, and just guessing again on error instead of using apt search

Now try it yourself

Run sudo apt update (you may be asked for your password). Then run apt search git and note down how many results show up.

You'll know it worked when: After sudo apt install htop, the htop command can be run from anywhere in the terminal.