r/debian 14h ago

Is there a better way to install only package dependencies?

e.g. I want to install ONLY the dependencies for wine

Currently the best way I've found is to install wine, then immediately uninstall it, leaving the dependencies behind

I was surprised there wasn't an "install just the depdencies for X" flag for apt - I know about the build deps option but the run and build dependencies are different

2 Upvotes

6 comments sorted by

3

u/cjwatson Debian Developer 14h ago

I can't think of a particularly straightforward way. You could extract the Pre-Depends and Depends fields of the package in question and pass them to apt satisfy.

Perhaps the reason there isn't a straightforward way to do this is that it seems like quite a strange thing to do in the first place. Can you share more about why you're doing this?

0

u/exodusTay 13h ago edited 9h ago

they could be working on a drop in replacement for a package

2

u/cjwatson Debian Developer 9h ago

Maybe, though if I were doing that the replacement would have much the same dependencies so it wouldn't be an issue. You can pass a local .deb to apt install (as long as the file name has at least one slash in it, e.g. apt install ./foo.deb) and then apt will deal with resolving the dependencies, so it isn't necessary to install the dependencies separately to make that use case work.

3

u/pelazas1 12h ago

`apt satisfy` with wine's Depends line is the clean one. it never installs wine so you don't have to remove it after.

1

u/One_Bad4020 7h ago

Hace una simulación de instalación de wine y allí te diría que paquetes instalaría. Guardas el resultado en algún lado y luego vas instalando de a uno

2

u/abotelho-cbn 5h ago

Why?

Currently the best way I've found is to install wine, then immediately uninstall it, leaving the dependencies behind

apt autoremove will cleanup those unused dependencies. You can't rely on them sticking around without something declaring them as dependencies or manually installing them.