> For the complete documentation index, see [llms.txt](https://devops-3.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devops-3.gitbook.io/devops/docs/linux-cheat-sheet/package-management.md).

# Package Management

| Command                                                | Description                 | Example                                                         |
| ------------------------------------------------------ | --------------------------- | --------------------------------------------------------------- |
| <mark style="color:purple;">**Debian/Ubuntu**</mark>   |                             |                                                                 |
| <mark style="color:red;">**apt update**</mark>         | Update package index.       | sudo apt update → Refreshes the list of available packages.     |
| <mark style="color:red;">**apt upgrade**</mark>        | Upgrade installed packages. | sudo apt upgrade → Installs updates for all installed packages. |
| <mark style="color:red;">**apt install \[pkg]**</mark> | Install a package.          | sudo apt install nginx → Installs the nginx package.            |
| <mark style="color:red;">**apt remove \[pkg]**</mark>  | Remove a package.           | sudo apt remove nginx → Removes the nginx package.              |
| <mark style="color:purple;">**RedHat/CentOS**</mark>   |                             |                                                                 |
| <mark style="color:red;">**yum update**</mark>         | Update package index.       | sudo yum update → Refreshes the list of available packages.     |
| <mark style="color:red;">**yum install \[pkg]**</mark> | Install a package.          | sudo yum install httpd → Installs the httpd package.            |
| <mark style="color:red;">**yum remove \[pkg]**</mark>  | Remove a package.           | sudo yum remove httpd → Removes the httpd package.              |
