# whypkg
> **Canonical:** [gitlab.com/safteinzz/whypkg](https://gitlab.com/safteinzz/whypkg) · **Mirror:** [github.com/safteinzz/whypkg](https://github.com/safteinzz/whypkg)
wonder why the f* you have that package? know it now - a fast, cross-distro package investigator (apt, pacman, dnf, flatpak)
## Install
```bash
cargo install whypkg
```

## What have I actually got?
`[M]` you installed it · `[A]` something pulled it in · `[F]` flatpak app · `↑` upgrade waiting

## What was that thing called?
Type to filter. It matches descriptions as well as names, which is the only way
anyone finds a flatpak app by the name on its window.

## Why is this here?

**pulled in by clang.** That is the whole point. You also get what it arrived
alongside, whether it came from a repo or a local file you sideloaded (or a repo
that no longer exists), what needs it and what it needs. `Enter` on anything in
the list follows the thread; `Esc` comes back.
## What is around it?
`Ctrl-G` draws the neighbourhood in the terminal. No browser, no image protocol,
so it survives ssh and tmux.

`Enter` re-centres on a neighbour and keeps digging, `Esc` retraces.
## What is this upgrade about to pull down?

Every package with an upgrade waiting, and why it is on your machine. Pipe it,
grep it, diff it before and after.
## Commands
```bash
whypkg # browse every installed package
whypkg --upgradable # browse only packages with an upgrade waiting
whypkg pending # full report, grouped by what pulled things in
whypkg pending --quick # one line per package: size + reason
whypkg self update # reinstall whypkg from crates.io
whypkg self check # is there a newer release?
```
`whypkg pending` also takes `--kernel`, `--apps`, `--auto` and `--sizes` to show
one section at a time.
## Keys
| any character | filter, on names and descriptions |
| `↑` `↓` or `Ctrl-P` `Ctrl-N` | move |
| `Tab` | cycle all / manual / auto / flatpak |
| `Enter` | open the highlighted package |
| `←` `→` | inside a package, flip between what needs it and what it needs |
| `Ctrl-G` | the dependency graph |
| `Esc` | back one level, and quit at the top |
| `Ctrl-C` | quit |
| `←` `↓` `↑` `→` or `hjkl` | move between packages |
| `Enter` | re-centre on the selected package |
| `Ctrl-G` | open that package's dossier |
| `Esc` | retrace, then leave the graph |
| `q` | leave the graph |
## Distro support
| Debian / Ubuntu (apt) | ✅ working |
| Arch (pacman) | ✅ working |
| Fedora / RHEL (dnf) | ✅ working |
| Flatpak | ✅ working |
Flatpak apps appear alongside your system packages whenever flatpak is
installed. Each package manager sits behind a single `Backend` trait, so the
analysis and the interface are distro-agnostic.
## It never touches your system
whypkg only reads. It will not sync, install or remove anything. The upgrade
list reflects your last database refresh (`apt update`, `pacman -Sy`,
`dnf makecache`), exactly like your package manager's own listing does.
Everything loads once at startup into an in-memory graph, so every hop while you
browse is a hash-map lookup rather than a subprocess. The slow part is your
package manager's own queries, about half a second.
It started as the bash `apt-why` / `apt-pending` scripts, kept in
[`legacy/`](https://gitlab.com/safteinzz/whypkg/-/tree/main/legacy).
## License
AGPL-3.0-only.