Package Management

Command
Description
Example

Debian/Ubuntu

apt update

Update package index.

sudo apt update → Refreshes the list of available packages.

apt upgrade

Upgrade installed packages.

sudo apt upgrade → Installs updates for all installed packages.

apt install [pkg]

Install a package.

sudo apt install nginx → Installs the nginx package.

apt remove [pkg]

Remove a package.

sudo apt remove nginx → Removes the nginx package.

RedHat/CentOS

yum update

Update package index.

sudo yum update → Refreshes the list of available packages.

yum install [pkg]

Install a package.

sudo yum install httpd → Installs the httpd package.

yum remove [pkg]

Remove a package.

sudo yum remove httpd → Removes the httpd package.

Last updated