This post will guide you how to install deb files on Ubuntu Linux 18.04 or 16.04. How do I install deb packages from command line on Ubuntu Linux. How to install debian .deb packages using the default Software Center via Ubuntu GUI on Ubuntu or Debian Linux.
- What is Deb File?
- Downloading Deb Packages
- Installing Deb File using Apt
- Installing Deb File Using Gdebi
- Installing Deb File Using Dpkg
- Installing Deb file Using Default Software Center
- Removing Deb Packages Using Apt
- Removing Deb Packages Using Dpkg
What is Deb File?
Deb is the format, as well as extension of the software package format for the Linux distribution Debian and its derivatives. Deb is an extension of Debian package, and it is also an installation package format used by Debian or Ubuntu Linux or Debian based distributions. You can install or uninstall Deb packages from both command line or GUI.
Downloading Deb Packages
Assuming that you want to install Skype on your Ubuntu system, you can download deb package of Skype from its official web page. You can use one of the following commands to get the Deb package of skype,type:
$ wget https://repo.skype.com/latest/skypeforlinux-64.deb
Or
$ curl -O https://repo.skype.com/latest/skypeforlinux-64.deb
Outputs:
devops@devops-osetc:~$ wget https://repo.skype.com/latest/skypeforlinux-64.deb --2019-03-27 03:51:43-- https://repo.skype.com/latest/skypeforlinux-64.deb Resolving www-proxy.us.osetc.com (www-proxy.us.osetc.com)... 148.87.19.20 Connecting to www-proxy.us.osetc.com (www-proxy.us.osetc.com)|148.87.19.20|:80... connected. Proxy request sent, awaiting response... 200 OK Length: 73441958 (70M) [application/x-debian-package] Saving to: ‘skypeforlinux-64.deb’ skypeforlinux-64.deb 100%[==========================================================================>] 70.04M 406KB/s in 2m 58s 2019-03-27 03:54:42 (404 KB/s) - ‘skypeforlinux-64.deb’ saved [73441958/73441958] devops@devops-osetc:~$ ls skypeforlinux-64.deb skypeforlinux-64.deb devops@devops-osetc:~$ curl -O https://repo.skype.com/latest/skypeforlinux-64.deb % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 70.0M 100 70.0M 0 0 398k 0 0:03:00 0:03:00 --:--:-- 408k
Installing Deb File using Apt
You can use apt command to install deb packages on Ubuntu system, and only need to provide the absolute path of deb package. for example, if the package is located in your current directory, you can use ./ path before the package name. If you do not provide a path before deb package, APT toll will try to install the package from the Ubuntu default repositories.
To install deb package of skype on your Ubuntu or Debian system, just execute the following command:
$ sudo apt install ./skypeforlinux-64.db
Outputs:
devops@devops-osetc:~$ sudo apt install ./skypeforlinux-64.deb [sudo] password for devops: Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'skypeforlinux' instead of './skypeforlinux-64.deb' The following NEW packages will be installed: skypeforlinux 0 upgraded, 1 newly installed, 0 to remove and 33 not upgraded. Need to get 0 B/73.4 MB of archives. After this operation, 243 MB of additional disk space will be used. Get:1 /home/devops/skypeforlinux-64.deb skypeforlinux amd64 8.34.0.78 [73.4 MB] Selecting previously unselected package skypeforlinux. (Reading database ... 242210 files and directories currently installed.) Preparing to unpack .../devops/skypeforlinux-64.deb ... Unpacking skypeforlinux (8.34.0.78) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Setting up skypeforlinux (8.34.0.78) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for hicolor-icon-theme (0.17-2) ...
From the above outputs, you would notice that the apt tool can resolve and install all dependency packages for skype deb package.
Installing Deb File Using Gdebi
You can also use another tool called Gdebi to install the local deb packages on your Ubuntu or Debian Linux. And this tool is not installed by default in Ubuntu system, so you need to install it with apt command, type:
$ sudo apt install gdebi
Outputs:
devops@devops-osetc:~$ sudo apt install gdebi Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: gnome-icon-theme The following NEW packages will be installed: gdebi gnome-icon-theme 0 upgraded, 2 newly installed, 0 to remove and 33 not upgraded. Need to get 9,644 kB of archives. After this operation, 15.7 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 gnome-icon-theme all 3.12.0-3 [9,620 kB] Get:2 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 gdebi all 0.9.5.7+nmu2 [23.7 kB] Fetched 9,644 kB in 4s (2,639 kB/s) Selecting previously unselected package gnome-icon-theme. (Reading database ... 242334 files and directories currently installed.) Preparing to unpack .../gnome-icon-theme_3.12.0-3_all.deb ... Unpacking gnome-icon-theme (3.12.0-3) ... Selecting previously unselected package gdebi. Preparing to unpack .../gdebi_0.9.5.7+nmu2_all.deb ... Unpacking gdebi (0.9.5.7+nmu2) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Setting up gnome-icon-theme (3.12.0-3) ... update-alternatives: using /usr/share/icons/gnome/scalable/places/debian-swirl.svg to provide /usr/share/icons/gnome/scalable/places/start-here.svg (start-here.svg) in auto mode Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Setting up gdebi (0.9.5.7+nmu2) ...
You can check the version of gdebi you just installed to check if the gdebi package has been installed successfully, type:
$ gdebi --version
Outputs:
devops@devops-osetc:~$ gdebi --version 0.9.5.7+nmu2
Once you installed the gdebi tool on your system, you can install the local deb package of skype with gdebi tool, just type the following command:
$ sudo gdebi skypeforlinux-64.deb
Outputs:
devops@devops-osetc:~$ sudo gdebi skypeforlinux-64.deb Reading package lists... Done Building dependency tree Reading state information... Done Reading state information... Done Skype keeps the world talking, for free. Skype keeps you together. Call, message and share with others. * It's free to download and join. * Call, instant message and send photos and documents to anyone else on Skype. * Easily text message anywhere in the world. * Get your friends together on a group call. And that's just the start... Do you want to install the software package? [y/N]:y Selecting previously unselected package skypeforlinux. (Reading database ... 236393 files and directories currently installed.) Preparing to unpack skypeforlinux-64.deb ... Unpacking skypeforlinux (8.34.0.78) ... Setting up skypeforlinux (8.34.0.78) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for hicolor-icon-theme (0.17-2) ...
Note: when prompted “Do you want to install the software package? [y/N]:”, you need type y to continue with the installation of skype deb package. The Gdebi tool can also download and install all required dependency packages.
Installing Deb File Using Dpkg
When you want to install a local deb package, the most common way to install deb package on Debian or Ubuntu system is by use of dpkg tool. And the dpkg tool have one big problem is that it can not resolve dependencies.
To install a local deb package using dpkg command with -i or –install option, just type:
$ sudo dpkg -i skypeforlinux-64.deb
Outputs:
devops@devops-osetc:~$ sudo dpkg -i skypeforlinux-64.deb Selecting previously unselected package skypeforlinux. (Reading database ... 236393 files and directories currently installed.) Preparing to unpack skypeforlinux-64.deb ... Unpacking skypeforlinux (8.34.0.78) ... Setting up skypeforlinux (8.34.0.78) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for hicolor-icon-theme (0.17-2) ...
Note: if you get any dependency errors (dpkg: error processing package ) when install deb packages using dpkg on your system, you can use the following apt command to install all required package dependencies. type:
$ sudo apt install -f
Installing Deb file Using Default Software Center
If you are using Ubuntu’s graphical user interface, you can also use the default software center to install deb packages. And you just need to go to the directory where you have downloaded the deb file, and double click on it. Just do the following steps:
#1 double click on the Deb file that you want to install. Or Right click on the Deb package and select Open With Software Install from the popup menu list.
#2 the Software Center window will appear. Then click Install button, and the Authenticate dialog will open.
#3 enter your password in the Authenticate dialog box, and click on the Authenticate button to continue.
#4 you should see that the deb file has been installed on your system.
#5 you can start skype from the application menu or type skypeforlinux command in Ubuntu terminal to launch the skype application.
Removing Deb Packages Using Apt
If you have the package name that you have installed on your Ubuntu or Debian system, then you can use apt command with remove sub-command to remove it. So you can use apt list –installed command to list all installed packages, and combining with grep command to find package names that you want to remove. type:
$ sudo apt list --installed | grep skype
Outputs:
devops@devops-osetc:~$ sudo apt list --installed | grep skype WARNING: apt does not have a stable CLI interface. Use with caution in scripts. skypeforlinux/now 8.34.0.78 amd64 [installed,local]
From the above outputs, you can see that the exact package name is skypeforlinux, then you can use apt remove command to remove it, type:
$ sudo apt remove skypeforlinux
Outputs:
devops@devops-osetc:~$ sudo apt remove skypeforlinux Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: skypeforlinux 0 upgraded, 0 newly installed, 1 to remove and 33 not upgraded. After this operation, 243 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 236515 files and directories currently installed.) Removing skypeforlinux (8.34.0.78) ... dpkg: warning: while removing skypeforlinux, directory '/opt' not empty so not removed Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for hicolor-icon-theme (0.17-2) ...
Removing Deb Packages Using Dpkg
You can use dpkg tool to find the installed packages and remove it.
Firstly, you need to use dpkg command with -l command and combining with grep command to find the package that you want to remove. type:
$ sudo dpkg -l | grep skype
Outputs:
devops@devops-osetc:~$ sudo dpkg -l | grep skype ii skypeforlinux 8.34.0.78 amd64 Skype keeps the world talking, for free.
From the above outptus, you can see the package name, then you can use dpkg command with -r option to remove it, type:
$ sudo dpkg -r skypeforlinux
Outputs:
devops@devops-osetc:~$ sudo dpkg -r skypeforlinux (Reading database ... 236515 files and directories currently installed.) Removing skypeforlinux (8.34.0.78) ... dpkg: warning: while removing skypeforlinux, directory '/opt' not empty so not removed Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index...
Conclusion
You should know that how to install Deb files on Ubuntu 16.04 or 18.04 or Debian Linux from this guide, and you also know how to install Deb Packages with the different methods on Ubuntu Linux server(dpkg, apt, gdebi, or GUI).