When you use
apt to install a package, under the hood it uses
dpkg. When you install a package using apt, it first creates a list of all the dependencies and downloads it from the repository.
Once the download is finished it calls
dpkg to install all those files, satisfying all the dependencies.
So if you have a
.deb file, you can install it by:
sudo dpkg -i /path/to/deb/file sudo apt-get install -f
sudo apt install ./name.deb
sudo apt install /path/to/package/name.deb
apt-get versions you must first move your deb file to
/var/cache/apt/archives/ directory. For both, after executing this command, it will automatically download its dependencies.
- First installing
gdebiand then opening your .deb file using it (Right-click -> Open with). It will install your .deb package with all its dependencies.
Note: APT maintains the package index which is a database (
/var/cache/apt/*.bin) of available packages available in repo defined in
/etc/apt/sources.list file and in the
/etc/apt/sources.list.d directory. All these methods will fail to satisfy the software dependency if the dependencies required by the deb is not present in the package index.
sudo apt-get install -f after
sudo dpkg -i /path/to/deb/file (as mentioned in method 1)?
-f, --fix-broken Fix; attempt to correct a system with broken dependencies in place.
dpkg installs a package and a package dependency is not satisfied, it leaves the package in an “unconfigured” state and that package is considered broken.
sudo apt-get install -f command tries to fix this broken package by installing the missing dependency.
foo.deb file with
dpkg -i foo.deb. If there are some errors with unresolved dependencies, run
apt-get install -f afterwards.
You can install a local .deb package by:
sudo apt install ./foo.deb
Make sure to specify a local relative or absolute path (
./ if in current dir), otherwise it will look for
foo.deb in the remote repos and fail.