Docs / Linux Basics / How to Use the Linux Package Manager

How to Use the Linux Package Manager

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 275 views · 1 min read

Package managers install, update, and remove software on your server.

APT (Ubuntu / Debian)

# Update package list
apt update

# Upgrade installed packages
apt upgrade -y

# Install a package
apt install nginx -y

# Remove a package
apt remove nginx

# Remove package and config
apt purge nginx

# Search for packages
apt search nginx

# Clean up
apt autoremove -y
apt clean

DNF (AlmaLinux / Rocky / CentOS)

# Update all packages
dnf update -y

# Install a package
dnf install nginx -y

# Remove a package
dnf remove nginx

# Search
dnf search nginx

# List installed
dnf list installed

# Clean cache
dnf clean all

Was this article helpful?