# APT
APT, or Advanced Package Tool, is the core software management system for Debian and its derivatives like Ubuntu. It is a powerful command-line tool that automates the process of installing, upgrading, configuring, and removing software packages, handling complex dependencies automatically.
**Pronunciation:** A-P-T
**Difficulty:** Beginner
**Synonyms:** apt-get, aptitude
**Categories:** Software Management, Operating Systems
**Tags:** package manager, debian, ubuntu, linux, command-line, software management
Canonical: https://scaleengineer.com/glossaries/apt
---
## Definitions

- **APT as a Package Management System:** **APT** (Advanced Package Tool) is a free and open-source software framework that automates the management of software packages on Debian and its many derivatives, such as Ubuntu, Linux Mint, and Kali Linux. It acts as a high-level front-end to the core `dpkg` system.

***Key Concepts***
*   **Repositories**: **APT** works by connecting to software repositories, which are essentially large storage servers holding collections of software packages. The locations of these repositories are defined in the `/etc/apt/sources.list` file and the `/etc/apt/sources.list.d/` directory.
*   **Dependency Resolution**: This is **APT**'s most critical feature. When you request to install a package, **APT** automatically calculates, downloads, and installs all other packages (dependencies) that your chosen package needs to function correctly.
*   **Package Index**: **APT** maintains a local cache or index of all available packages from the repositories. The `apt update` command synchronizes this local index with the remote repositories to ensure it has the latest information.

***Common Commands***
*   `sudo apt update`: Refreshes the local package index.
*   `sudo apt upgrade`: Upgrades all installed packages to their newest versions.
*   `sudo apt install <package-name>`: Installs a new package and its dependencies.
*   `sudo apt remove <package-name>`: Uninstalls a package but leaves its configuration files.
*   `sudo apt purge <package-name>`: Uninstalls a package and removes its configuration files.
*   `apt search <search-term>`: Searches the repositories for a package.
*   `apt show <package-name>`: Displays detailed information about a package.

## Etymology

APT is an acronym for Advanced Package Tool.

## First used

1998

## Historical context

Before **APT**, Debian systems relied on a lower-level tool called `dpkg` (Debian Package manager). While `dpkg` could install, remove, and provide information about individual `.deb` packages, it did not automatically handle dependencies. This often led to a frustrating situation known as "dependency hell," where users had to manually find and install all required packages one by one.

**APT** was introduced in 1998 with Debian 2.1 ("slink") to solve this problem. It was designed as a front-end for `dpkg` to automate dependency resolution and package retrieval from remote repositories. The original and most well-known tools in the suite were **apt-get** for package installation/removal and `apt-cache` for searching.

In 2014, with the release of Debian 8 and Ubuntu 16.04, the `apt` command was introduced. It combined the most commonly used functions of **apt-get** and `apt-cache` into a single, more user-friendly command with a cleaner output and a progress bar, quickly becoming the recommended tool for interactive use.

## Q&A

- **What is the primary purpose of APT?:** The primary purpose of APT is to automate and simplify software management on Debian-based Linux systems. This includes fetching packages from software repositories, handling dependencies, installing new software, upgrading existing packages to their latest versions, and cleanly removing packages that are no longer needed.
- **What is the difference between `apt update` and `apt upgrade`?:** The `apt update` command does not install or upgrade any packages. Instead, it downloads the latest package information from all configured software repositories and updates the local package index. This index contains metadata about available packages, such as version numbers and dependencies.

The `apt upgrade` command uses this updated index to compare the versions of installed packages with the latest available versions in the repositories. It then downloads and installs the newer versions for all packages that have an update available.
- **What file defines the software sources that APT uses?:** The primary file that defines the software sources, or repositories, is `/etc/apt/sources.list`. Additionally, individual repository files can be placed in the `/etc/apt/sources.list.d/` directory, which is the recommended practice for adding third-party repositories.

## Usage examples

- To get the latest security patches, the system administrator ran `sudo apt update && sudo apt upgrade` to update the system's software using **APT**.
- The developer needed to install a code editor and simply typed `sudo apt install code` into the terminal, letting **APT** handle all the required dependencies.
- Before the unified `apt` command became popular, users frequently used **apt-get** to install packages and `apt-cache` to search for them.
- For more complex dependency conflicts, some advanced users prefer **aptitude**, which provides a more interactive interface to the **APT** library.

## Related terms

- dpkg
- repository
- PPA (Personal Package Archive)
- .deb
- dependency
- sources.list

## Popular related terms

- dpkg
- apt-get
- repository
- Ubuntu
- Debian
