2016-12-22 00:09:01 +01:00
|
|
|
# apt
|
|
|
|
|
|
|
|
> Package management utility for Debian based distributions.
|
2022-01-08 09:15:33 +07:00
|
|
|
> Recommended replacement for `apt-get` when used interactively in Ubuntu versions 16.04 and later.
|
2022-12-05 08:57:55 +08:00
|
|
|
> For equivalent commands in other package managers, see <https://wiki.archlinux.org/title/Pacman/Rosetta>.
|
2024-09-18 11:00:49 +02:00
|
|
|
> More information: <https://manned.org/apt.8>.
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-09-23 11:27:18 +01:00
|
|
|
- Update the list of available packages and versions (it's recommended to run this before other `apt` commands):
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-04-17 18:02:14 +03:00
|
|
|
`sudo apt update`
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2025-04-20 00:21:53 +03:00
|
|
|
- Search for a given package (use `apt search --name-only package` to search within package name only):
|
2016-12-22 00:09:01 +01:00
|
|
|
|
|
|
|
`apt search {{package}}`
|
|
|
|
|
2017-04-17 12:47:20 +03:00
|
|
|
- Show information for a package:
|
|
|
|
|
|
|
|
`apt show {{package}}`
|
|
|
|
|
2017-09-23 11:27:18 +01:00
|
|
|
- Install a package, or update it to the latest available version:
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-04-17 18:02:14 +03:00
|
|
|
`sudo apt install {{package}}`
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-09-23 11:27:18 +01:00
|
|
|
- Remove a package (using `purge` instead also removes its configuration files):
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-04-17 18:02:14 +03:00
|
|
|
`sudo apt remove {{package}}`
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-09-23 11:27:18 +01:00
|
|
|
- Upgrade all installed packages to their newest available versions:
|
2016-12-22 00:09:01 +01:00
|
|
|
|
2017-04-17 18:02:14 +03:00
|
|
|
`sudo apt upgrade`
|
2019-04-24 08:01:22 -04:00
|
|
|
|
|
|
|
- List all packages:
|
|
|
|
|
|
|
|
`apt list`
|
|
|
|
|
|
|
|
- List installed packages:
|
|
|
|
|
2025-04-20 00:21:53 +03:00
|
|
|
`apt list {{[-i|--installed]}}`
|