Install a local .deb file with its dependencies

Sometimes, I have to install a local .deb package. When doing so, it happens that I miss some required dependencies. When using dpkg -i mypackage.deb, it fails for each missing dependency, making it a tedious task to install each of them.

I just found out that apt is capable of installing a local package with its dependencies, when doing apt install:

sudo apt install ./package.deb

EDIT: You don't actually need --fix-broken

Published on 2025-11-12 #debian - In code