3 Command Line Tools to Help You Install Local Debian Package

If you are asking yourself “How do I install debian package in Ubuntu or Debian?”, then you have come to the right place.

You can right-click on the downloaded deb packages and select install from the context menu but using a graphical installer can be slow compared to terminal commands. Here’s 3 different command line tools to help you install deb packages. They are dpkg, gdebi and apt.

dpkg

You use dpkg to install local debian package like below.

sudo dpkg -i package_name.deb

dpkg itself can’t solve dependency problem because it does not understand repositories. But you can use the following command to solve it. (-f for fixing broken dependency).

sudo apt-get -f install

gdebi package installer

gdebi isn’t installed by default on Ubuntu, so you need to install it first.

sudo apt install gdebi-core

Then to install a local deb package, use

sudo gdebi package_name.deb

If there’s a dependency problem, gdebi will automatically install them for you, if these dependency packages are available from software repository.

apt

Normally you would use apt to install packages from online software repositories like below:

sudo apt install firefox

Did you know that it can also be used to install local deb packages? This is another reason you should be using apt instead of apt-get, which does not have the ability. You simply change to the directory where the deb package are stored and install it like below.

cd /path/to/the/deb-package/
sudo apt install ./package_name.deb

For instance, to install TeamViewer 12 on Ubuntu 16.04/16.10, first download the TeamViewer deb package to the current directory

wget https://downloadus1.teamviewer.com/download/version_12x/teamviewer_12.0.69753_i386.deb

Then install it with:

sudo apt install ./teamviewer_12.0.69753_i386.deb

It automatically install dependencies if these dependencies are available from software repository.

using apt to install local deb packages

You need to add ./, which represents the current working directory, in front of the package name so that apt can find the deb package.

That’s it!

I hope this post helped you install local debian packages from the command line. As always, if you found this post useful, then Subscribe to our free newsletter to get latest Linux tutorials. You can also follow us on Google+Twitter or like our Facebook page.

Rate this tutorial
[Total: 2 Average: 3.5]