Package Management
Objective: Understand how Linux installs, updates, and removes software.
Every service you've installed used apt. But do you understand what happened? Where did the software come from? How does your system know what's available? What happens when packages conflict?
Instead of downloading .exe files from random websites, Linux pulls software from curated repositories. The package manager handles downloading, installing, dependency resolution, and updates.
Repositories: Servers that host software packages. Ubuntu has: main (officially supported), universe (community), restricted (proprietary), multiverse (non-free).
Dependencies: Software that other software needs to run. apt resolves these automatically.
PPAs: Personal Package Archives. Third-party repos. Use with caution.
Updating vs. Upgrading: apt update refreshes the package list. apt upgrade installs newer versions.
sudo apt updateRefresh the package index from all repossudo apt upgradeUpgrade all installed packages to latest availablesudo apt install [package]Install a packagesudo apt remove [package]Remove (keeps config files)sudo apt purge [package]Remove package and its config filessudo apt autoremoveRemove packages no longer needed as dependenciesapt search [keyword]Search available packagesapt show [package]Show detailed info about a packagedpkg -lList all installed packagesdpkg -L [package]List all files installed by a packageapt-cache policy [package]Show available versions and which repo they come from
Run sudo apt update && sudo apt upgrade. Document what happened. How many packages were upgraded? Were any held back? Why?
Install a package you haven't used (e.g., tree, ncdu, tmux). Use dpkg -L to see every file it installed. Where did the binary end up? Where are the config files?
Remove with apt remove. Check if config files remain. Remove them with apt purge. Explain the difference.
Run apt-cache policy nginx. What version is available? Which repo is it coming from?
View /etc/apt/sources.list. Document what repos your system pulls from. Explain what main, universe, and restricted mean.
Simulate a broken dependency: install a package, manually remove a dependency with dpkg --remove. See what happens. Fix with sudo apt --fix-broken install.
- package-management-reference.mdEvery apt and dpkg command, what it does, when to use it.
- repos-explained.mdYour sources list breakdown, what each repo is, what PPAs are.
- challenge-notes.mdOutput and notes from each challenge, including the broken dependency experiment.
- Get a Machine Running
- Know Your Hardware
- Learn to Talk to Your Machine
- Break It, Fix It
- Networking Fundamentals
- Users, Permissions, Security, and Remote Access
- Package Management
- Services and Self-Hosting
- Bash Scripting and Automation
- GitHub and Collaboration
- Python Programming
- Professional Communication
- Capstone Project