Package Management
5 min read Quiz at the end
Install packages with apt install on Ubuntu/Debian and dnf install on Red Hat. Always run apt update before installing. apt remove uninstalls and apt autoremove cleans unused dependency packages.
Installing Software Debian/Ubuntu (apt) sudo apt update
sudo apt install nginx
sudo apt upgrade
sudo apt remove nginx
apt search apacheRed Hat/CentOS (dnf/yum) sudo dnf install nginx
sudo dnf update
sudo dnf remove nginxArch (pacman) sudo pacman -S nginx
sudo pacman -Syu # update all
Topic Quiz · 5 questions
Test your understanding before moving on
1. Which package manager does Ubuntu use?
A. yum
B. dnf
C. pacman
D. apt
💡 Ubuntu and Debian-based distros use apt (Advanced Package Tool).
2. sudo apt update does what?
A. Upgrades all packages
B. Installs new packages
C. Updates the package list (not packages)
D. Removes old packages
💡 apt update refreshes the list of available packages and their versions.
3. How do you install nginx on Ubuntu?
A. yum install nginx
B. dnf install nginx
C. sudo apt install nginx
D. pkg install nginx
💡 On Ubuntu: sudo apt install nginx.
4. Which distro uses pacman?
A. Ubuntu
B. Fedora
C. Arch Linux
D. CentOS
💡 Arch Linux uses the pacman package manager.
5. sudo apt upgrade does what?
A. Updates package list
B. Installs new packages
C. Upgrades all installed packages
D. Removes unused packages
💡 apt upgrade upgrades all installed packages to their latest available versions.
Submit answers