dpkg -i: Usage, Options & Common CI Errors
dpkg -i installs a downloaded .deb package file, without fetching from a repository.
dpkg is the low-level Debian package tool. dpkg -i installs a .deb you already have - common in CI when a vendor ships a downloadable .deb - but unlike apt it does not resolve dependencies for you.
What it does
dpkg -i unpacks and configures a local .deb file. It does NOT download or install missing dependencies; if any are absent the install leaves the package half-configured. The standard CI idiom is dpkg -i pkg.deb followed by apt-get install -f -y to pull in the dependencies.
Common usage
dpkg -i ./google-chrome-stable_current_amd64.deb
dpkg -i ./pkg.deb || apt-get install -f -y # fix missing deps
apt-get install -y ./pkg.deb # apt resolves deps for you
dpkg --configure -a # recover an interrupted dpkgCommon errors in CI
"dependency problems prevent configuration of X" - dpkg installed the .deb but its dependencies are missing; run apt-get install -f -y (or just use apt-get install ./pkg.deb, which resolves them). "dpkg: error: dpkg frontend lock was locked by another process" means a parallel apt/dpkg is running. "E: dpkg was interrupted, you must manually run dpkg --configure -a" appears after a killed install (common when a build times out mid-install) - that command finishes the pending configuration.
Options
| Flag | What it does |
|---|---|
| -i / --install <file> | Install a local .deb |
| -r / --remove <pkg> | Remove an installed package |
| --configure -a | Configure all unpacked-but-unconfigured packages |
| --force-depends | Install despite dependency problems (risky) |
| -l / -L | List packages / files in a package |