Software & Configuration
Package Installation
How to install, update and remove software on your Linux server
Debian / Ubuntu: APT
Update the package list
apt updateInstall a package
apt install package-name
# Multiple packages together
apt install nginx curl wget git unzipUpdate all packages
apt upgrade -y
# Full upgrade (includes kernel and changed dependencies)
apt full-upgrade -yRemove a package
apt remove package-name
# Also remove configuration files
apt purge package-name
# Remove packages that are no longer needed
apt autoremove -ySearch for a package
apt search keywordCentOS / AlmaLinux / Rocky Linux: DNF
Install a package
dnf install package-name -yUpdate all packages
dnf update -yRemove a package
dnf remove package-nameSearch for a package
dnf search keywordUseful commands
Find which package provides a command
# Debian/Ubuntu
dpkg -S $(which command)
# CentOS
dnf provides commandSee installed packages
# Debian/Ubuntu
dpkg -l | grep name
# CentOS
rpm -qa | grep nameSoftware not in official repositories
For software that is not in standard repositories, you often use:
Snap:
apt install snapd
snap install package-nameFlatpak (less common on servers):
apt install flatpakFrom source or script:
# Example: installing Node.js via official script
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejsBefore executing scripts from the internet with curl | bash, always verify that the source is official and trustworthy.