Software & Configuration

Package Installation

How to install, update and remove software on your Linux server

Debian / Ubuntu: APT

Update the package list

apt update

Install a package

apt install package-name

# Multiple packages together
apt install nginx curl wget git unzip

Update all packages

apt upgrade -y

# Full upgrade (includes kernel and changed dependencies)
apt full-upgrade -y

Remove a package

apt remove package-name

# Also remove configuration files
apt purge package-name

# Remove packages that are no longer needed
apt autoremove -y

Search for a package

apt search keyword

CentOS / AlmaLinux / Rocky Linux: DNF

Install a package

dnf install package-name -y

Update all packages

dnf update -y

Remove a package

dnf remove package-name

Search for a package

dnf search keyword

Useful commands

Find which package provides a command

# Debian/Ubuntu
dpkg -S $(which command)

# CentOS
dnf provides command

See installed packages

# Debian/Ubuntu
dpkg -l | grep name

# CentOS
rpm -qa | grep name

Software not in official repositories

For software that is not in standard repositories, you often use:

Snap:

apt install snapd
snap install package-name

Flatpak (less common on servers):

apt install flatpak

From source or script:

# Example: installing Node.js via official script
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs

Before executing scripts from the internet with curl | bash, always verify that the source is official and trustworthy.

On this page