How to Install deb File in Ubuntu – 4 Ways Described for beginners

How to Install deb File in Ubuntu – 4 Ways Described for beginners

How will you install packages which are not available in the software center?

Basically there are are many software’s are available on Ubuntu software center, and you can install those very easily by using an apt and apt-get command as well as by graphical Interface.

If the software does not exist on the software center and you want to install on your ubuntu operating system then you must download first from the official website of that particular software.

if you want to install external you must download the executable file in .deb format for Debian and Ubuntu-based operating system.

This tutorial will cover how to install Deb file in Ubuntu operating system using different methods. I will cover command-line methods as well as the graphical interface for installing deb files on ubuntu.

Article Content

What is the .deb file?

deb files are executable file for the Debian-based Linux distribution. In general word, you can install software by using a .deb package.

When you install any software on the windows then you download .exe file first. and you can install software by using this executable file.

Similar to Windows you can install the software by using the .deb executable file. So keep in mind if you are going to download an executable file from the vendor’s official website it would be in .deb format.

Why install a deb file manually

Most of the time you use a package manager such as the Ubuntu Software Center to install the new software on Debian-based distribution. You use apt and apt-get command for downloading and installing new software from the repository.

Some application does not exist on the software center/repository then you must download from the vendor’s website first. Be careful before downloading and installing such type of files which are not available on the repository.

Some of the biggest applications are delivered in this format, including Google’s Chrome web browser. For this reason, it is important to know how to install the packages manually.

How to download deb Package

You must go to the vendor’s website and download the executable file in .deb format. Don’t forget system architecture before downloading the .deb file. If you are running 32 bit then download deb file for 32 bit otherwise for 64 bit.

For the demonstration purpose, I am going to install TeamViewer on my Ubuntu operating system, then first I will have to go on the vendor’s website teamviewer.com then I will search for Teamviewer executable file in .deb format.

I found there are two types of the .deb packages, one is 32 bit another 64 bit. I have the installed Ubuntu operating system 64 bit. So I download 64 bit .deb file. The file name is teamviewer_14.5.1691_amd64.deb

How to install deb files on Ubuntu

Install deb files in Ubuntu by using dpkg tool

You can install and uninstall Debian (.deb) packages by using the tool “dpkg”. This is a command-line tool. You can do many things by using this tool, for Now, I am going to teach you how to install deb file in Linux by using dpkg command.

So run the following command in terminal.

$sudo dpkg -i /path_to_package/packagename

For example, to install Teamviewer, My downloaded .deb file in Download folder, the path is /home/vijay/Download and the file name is teamviewer_14.5.1691_amd64.deb.

So the command will be as following:

vijay@Ubuntu19:~$sudo dpkg -i /home/vijay/Downloads/teamviewer_14.5.1691_amd64.deb

You can use –install switch instead of -i and command will be as following:

vijay@Ubuntu19:~$sudo dpkg --install /home/vijay/Downloads/teamviewer_14.5.1691_amd64.deb

Install deb file in Ubuntu using apt Package Manager

If you come to installing .deb packages on you Debian based distribution then you have another option for it. you can use the apt package manager to install .deb package. Yes, you install the package locally on your system instead of the web.

Before go running the apt command for installing the new package use the apt update command to update the database.

$sudo apt update

As I have told you previously, apt has the advantage to resolve dependency error automatically. So you would not worry about the dependencies when using apt command.

If you have faced any problem-related dependency error then Please use apt command to install .deb file in ubuntu. See in the command below to install the same package as the previous example.

$sudo apt install /home/vijay/Downloads/teamviewer_14.5.1691_amd64.deb
vijay@Ubuntu19:~$sudo apt install /home/vijay/Downloads/teamviewer_14.5.1691_amd64.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 qr-code-creator : Depends: python but it is not installed
                   Depends: qrencode but it is not installed
 teamviewer : Depends: libqt5gui5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5widgets5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5qml5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5quick5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5dbus5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5webkit5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: libqt5x11extras5 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: qml-module-qtquick2 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: qml-module-qtquick-controls (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: qml-module-qtquick-dialogs (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: qml-module-qtquick-window2 (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
              Depends: qml-module-qtquick-layouts (>= 5.5) but it is not installed or
                       qt56-teamviewer but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
vijay@Ubuntu19:~$

In the above example, you can see there are multiple dependencies required for TeamViewer software. the apt tool didn’t install Teamviewer in the previous example and asked for installing dependency first.

You can use apt command followed by –fix-broken install for installing package and dependencies as well.

Command will be the following:

$sudo apt --fix-broken install /home/vijay/Downloads/teamviewer_14.5.1691_amd64.deb
0 upgraded, 39 newly installed, 0 to remove and 248 not upgraded.
2 not fully installed or removed.
Need to get 29.9 MB of archives.
After this operation, 126 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

Choose Y and hit enter, After some, you will that Teamviewer has been installed on your system.

Install deb file in Ubuntu using apt-get command

apt-get command is working similar as an apt command. You don’t need to change anything in apt command. You will use apt-get instead of apt.

Commands will look like following

$sudo apt-get update
$sudo apt-get install ~/Downloads/teamviewer_14.5.1691_amd64.deb
sudo apt-get --fix-broken install ~/Downloads/teamviewer_14.5.1691_amd64.deb

Install Deb file in Ubuntu by using GUI

The graphical interface is loved by everyone. One more thing about the graphical interface it’s very comfortable.

If you are one of the graphical interface lovers then you can use GUI to install deb file in ubuntu.

You can use the following steps:

Step 1: double click on downloaded .deb file it will open automatic in ubuntu software center.

63-double-click-on-downloaded-file

Step 2: Click on the “Install” button

64-click-on-the-install

Step 3: It will ask for authentication, give the current user password and click on the authenticate. If you don’t know you can’t install the package.

42-give-the-password

The installation process will start and after some time Teamviewer will be installed on your ubuntu system.

66-installing-deb-file-in-ubuntu

How to remove .deb package

You can use the following command to remove/uninstall the package

$sudo dpkg -r teamviewer
vijay@Ubuntu19:~$sudo dpkg -r teamviewer 
(Reading database ... 138049 files and directories currently installed.)
Removing teamviewer (14.5.1691) ...
Removed /etc/systemd/system/multi-user.target.wants/teamviewerd.service.
Clearing assignments ...
done
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-4ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
vijay@Ubuntu19:~$

If you want to remove a package along with configuration file then run the following command

$sudo dpkg -p teamviewer

When you uninstall the package it will remove the only package and dependency will remain in your computer so run the following command to remove unused dependency packages in your system.

$sudo apt autoremove
vijay@Ubuntu19:~$sudo apt autoremove 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5
  libqt5sensors5 libqt5webchannel5 libqt5webkit5 libqt5x11extras5
  qml-module-qtgraphicaleffects qml-module-qtquick-controls
  qml-module-qtquick-dialogs qml-module-qtquick-layouts
  qml-module-qtquick-privatewidgets qml-module-qtquick-window2
  qml-module-qtquick2
0 upgraded, 0 newly installed, 15 to remove and 248 not upgraded.
After this operation, 67.0 MB disk space will be freed.
Do you want to continue? [Y/n] 

If you want to remove package as well as its dependency then use the apt command followed by remove option and package name.

See the example below:

$sudo apt remove teamviewer
vijay@Ubuntu19:~$sudo apt remove teamviewer 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5
  libqt5sensors5 libqt5webchannel5 libqt5webkit5 libqt5x11extras5
  qml-module-qtgraphicaleffects qml-module-qtquick-controls
  qml-module-qtquick-dialogs qml-module-qtquick-layouts
  qml-module-qtquick-privatewidgets qml-module-qtquick-window2
  qml-module-qtquick2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  teamviewer
0 upgraded, 0 newly installed, 1 to remove and 248 not upgraded.
After this operation, 69.2 MB disk space will be freed.
Do you want to continue? [Y/n]

You can use GUI to uninstall the package follow the steps:

Step 1: Open software center in ubuntu

Step 2: Click on an Installed tab inside the ubuntu software center application

Step 3: Find the package name and Click on “Remove”.

69-uninstall-deb-file-in-ubuntu

Conclusion

By now you are able to understand about deb files. and how to install, uninstall deb file in ubuntu. How you can install .deb package with its dependency. and remove a package with its dependency as well.

If you like this article please share:

Thanks for Reading

Cheers

If Appreciate My Work, You should consider: