# APT Package Manager

## Description

* APT is a package manager for Debian-based Linux systems. This provides one approach for searching, installing, and removing software.

## Repositories

{% hint style="danger" %}
Always make sure you trust any repositories added to these files!
{% endhint %}

* APT searches in package repositories for available software which is defined in the following files:
  * `/etc/apt/sources.list`
  * `/etc/apt/sources.list.s`

## Examples

```bash
# discover package source
dpkg -S /path/to/file # output provides package name
apt info <packageName> # output provides package source
```

* `sudo apt update` - Updates the local APT cache
* `sudo apt upgrade` - Installs updates for any packages found in the `update` command
* `sudo apt upgrade impacket-scripts` - Updates a single package
* `apt search impacket-scripts` - Searches for a specific package
* `apt show impacket-scripts` - View a package's description
* `sudo apt install nmap` - Installs a package
* `sudo apt remove nmap` - Uninstalls a package
* `sudo apt remove --purge nmap` - Uninstalls a package and removes any user config files


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.techwithtyler.dev/operating-systems/linux/apt-package-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
