Linux Package Management (APT, DNF & Pacman)
Modern Linux distributions manage software through centralized package repositories. Choose your distribution tab inside each step to run the appropriate command.
Step 1: Refresh Repositories and Review System Updates
01
Refresh Repositories and Review System Updates
RepositoryRefresh package metadata first, then review and apply system updates as a separate, planned action. A full upgrade can restart services or require a reboot. Pacman requires a full system upgrade with -Syu; avoid refreshing only its package database with -Sy because partial upgrades are unsupported.
sudo apt updateapt list --upgradablesudo apt upgradesudo dnf makecache --refreshsudo dnf upgradesudo pacman -SyuStep 2: Install Software Packages
02
Install Software Packages
InstallationStep 3: Search Remote Repositories
03
Search Remote Repositories
DiscoveryStep 4: Clean Orphaned Packages & Caches
04
Clean Orphaned Packages & Caches
MaintenancePreview cleanup before confirming package removals. Package managers prompt before removing dependencies or clearing caches; read the proposed changes and stop if an application still needs a package.
sudo apt autoremove --purge && sudo apt cleansudo dnf autoremove && sudo dnf clean allmapfile -t orphans < <(pacman -Qtdq)if ((${#orphans[@]})); then printf 'Orphan packages to review:\n%s\n' "${orphans[@]}" sudo pacman -Rns -- "${orphans[@]}"else echo 'No orphan packages found.'fisudo pacman -Sc