Install deb packages with dependencies

In some cases when it comes to install packages ending in .deb in Debian or Ubuntu, you may come across an error about dependencies. Trying to install these dependencies manually can be a hassle and time-consuming process. Luckily, we can skip all that without needing to use dpkg.

Dpkg alone will not work as well for deb packages that need dependencies. With more recent versions of Debian and Ubuntu, this process is made simpler and significantly easier thanks to APT. APT can also serve as a replacement of dpkg for the installation of deb packages download through the internet or wget.

It’s as simple as using the following command to install a Debian package file:

sudo apt install ./packagefile.deb

APT will then look for all the dependencies it needs and install them automatically, saving you the hassle of digging around and finding some that may not even work with the program that you’re trying to install.

Do note that you will need to append the ./ before any package, which refers to the current directory that you’re on. Make sure that you are in the directory that the deb package file is in before performing an installation.