Package Management for Beginners

What You'll Learn

Instead of downloading .exe installers from websites, Linux uses package managers to install, update, and remove software from trusted repositories. This guide covers the three most common package managers.

apt — Debian, Ubuntu, Mint

sudo apt update                     # Refresh the list of available packages
sudo apt upgrade                    # Update all installed packages to latest versions
sudo apt install nginx              # Install a package (e.g., web server)
sudo apt remove nginx               # Remove a package (keeps config files)
sudo apt purge nginx                # Remove a package and its config files
sudo apt autoremove                 # Clean up unused dependencies
apt search keyword                  # Search for packages by name

Useful Tips

dnf — Fedora, RHEL, CentOS Stream

sudo dnf update                     # Update all packages (combines refresh + upgrade)
sudo dnf install nginx              # Install a package
sudo dnf remove nginx               # Remove a package
sudo dnf search keyword             # Search for packages
dnf list installed                  # List all installed packages

pacman — Arch Linux, Manjaro

sudo pacman -Syu                    # Sync databases and upgrade everything
sudo pacman -S nginx                # Install a package (-S = sync/install)
sudo pacman -R nginx                # Remove a package
pacman -Ss keyword                  # Search for packages
pacman -Qe                          # List explicitly installed packages

Universal Packages: Snap and Flatpak

Snap and Flatpak packages work across all Linux distributions:

# Snap (common on Ubuntu)
sudo snap install spotify
snap list                           # List installed snaps

# Flatpak (common on Fedora, GNOME-based distros)
flatpak install flathub org.gimp.GIMP
flatpak list                        # List installed flatpaks

Practice Exercise

# Update your system (use the command for your distro)
sudo apt update && sudo apt upgrade    # Debian/Ubuntu
# Install a few common tools
sudo apt install curl wget git htop tree
# Verify they installed
which curl
which git

Troubleshooting

What's Next?

You can install software — now learn to edit files in the terminal:

Terminal Text Editors: Nano & Vim →