3 Commands Line Tools to Install Local Debian Packages

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: 12 Average: 4]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here