Hands-on guide series

Package Management on Ubuntu: A Hands-On Guide

A nine-part, hands-on guide to installing and managing software on Ubuntu: apt, searching and inspecting packages, repositories and GPG keys, dpkg, pinning versions, PPAs, building from source, snap, and keeping a server patched. Every command run on a live Ubuntu server.

9 parts63 min totalBy Amith Kumar

What you will build

Security is layers, not a switch. Each part closes a different category of attack, from the automated sweep that finds a brand-new server, to the day one gets in anyway. Read them in order, or jump to what you need.

  1. 1apt Basics: update and upgradeLearn apt update and upgrade, the two commands you run before anything else on an Ubuntu server, and what each one does on a live machine.7 min
  2. 2Searching and Inspecting PackagesUse apt search and show to find a package and read its version, size and dependencies before you install it on an Ubuntu server.7 min
  3. 3Repositories and GPG KeysLearn how an apt repository is defined, how a GPG key proves a package is genuine, and read the deb822 sources file Ubuntu 24.04 ships with.7 min
  4. 4dpkg and .deb FilesThe dpkg command Linux runs under apt: list an installed package, see the files it placed, and map a file back to its package.7 min
  5. 5Holding and Pinning VersionsPin a package with apt-mark hold and stop a routine upgrade moving it, then confirm the hold on a live Ubuntu server.7 min
  6. 6PPAs and Third-Party RepositoriesAdd a PPA with add-apt-repository, and understand the trust you extend to that source, on a live Ubuntu server.7 min
  7. 7Building From SourceBuild from source on Linux when no package exists: fetch the code, then run configure, make, and make install to get a working binary.7 min
  8. 8snap and flatpakLearn what snap and flatpak on Ubuntu are, how they bundle dependencies unlike apt packages, and when each one is a sensible choice.7 min
  9. 9Keeping a Server PatchedSee how Ubuntu applies security updates automatically with unattended-upgrades, and check the setting on a live server so you know it is on.7 min