# dpkg

## Размер установленных пакетов

Иногда бывает необходимо выяснить сколько занимает дискового пространства установленный пакет или какие из установленных пакетов наиболее крупные.

Получить отсортированный по возрастанию размера список установленных пакетов с указанием их размера в килобайтах можно следующей командой:

```c
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
```

Для определения размера интересующего пакета можно отфильтровать вывод с помощью команды `grep`:

```c
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | grep php
```

Для получения десятка самых крупных пакетов можно воспользоваться командой tail:

```c
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 10
```

## Ссылки

<https://unix.stackexchange.com/questions/40442/which-installed-software-packages-use-the-most-disk-space-on-debian>


---

# 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://b.om.ua/os/linux/dpkg.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.
