# Package Management: apt — Linux Command Line Fundamentals

Source: https://www.skillbyai.com/en/linux/linux-apt

> Install, update and remove software on Debian and Ubuntu with apt, and search packages before installing.

## What a package manager does

A **package manager** downloads, installs, updates and removes software along with its dependencies, so you never manually chase `.tar.gz` files.

## apt basics

On Debian/Ubuntu, `apt` is the go-to tool. Always update the package index before installing.

```bash
sudo apt update              # refresh package index
sudo apt install htop        # install
sudo apt remove htop         # remove
sudo apt upgrade             # upgrade installed packages
```

## Search before installing

`apt search keyword` finds package names, and `apt show pkgname` shows details before you commit to installing.
