Debian Package (dpkg) is a Linux tool that allows you to easily download, install, uninstall and manage packages in Debian/Ubuntu Linux systems. It allows you to work with .deb files which are the default Debian software packages. If you are working with Debian/Ubuntu Linux then you will need to work with .deb packages. In this article, we will look at how to install dpkg dependencies automatically.
How to Install Dpkg dependencies automatically
The dpkg tool allows you to install, download an remove software packages from Debian/Ubuntu Linux systems. It also allows you to install as well as remove dependencies associated with .deb packages.
Here is the basic syntax to use dpkg command.
dpkg [options…] [filename…]
Here is an example to install a package, say, Teamviewer. By default, dpkg will only install the mentioned software and not its packages.
$ sudo dpkg -i teamviewer_amd64.deb
When we use -i option (for install) with dpkg command, it gives a detailed list of dependencies to be installed and whether they are installed or not.
It only installs the software if all dependencies are met. Otherwise, it will not install the software. Nevertheless, when you use -i option, it lists the various dependencies and whether they are installed or not.
Now if you want to also install dependencies automatically then use -f option.
$ sudo dpkg -f teamviewer_amd64.deb
In the above case, dpkg will automatically download and install the required dependencies before installing the required package of team viewer.
Sometimes it may ask for confirmation. In this message it will show which packages need to be installed and how much additional space it will require. You need to enter Y to confirm, N to cancel installation.
That’s it. In this article, we have learnt how to automatically install dependencies for given debian package.