Posted on • Originally published attech.serhatteker.com on
How to Install Deb Packages
.deb
is the installation package format used by allDebian based distributions likeUbuntu,Kali ,Linux Mint ,Pop!_OS etc. and of courseDebian itself.
In this post, I will explain how to install.deb
files onUbuntu. The same instructions apply for any otherDebian based distribution as mentioned above.
TheUbuntu repositories contain thousands ofdeb packages that can be installed either from theUbuntuSoftware Center or from the command line using theapt
.
However many applications are not included in theUbuntu or any 3rd party repositories. Another reason that you'd like to install a localdeb package would be their version on default package manager could be old and you'd like to get new version of them.
Thoseunofficial applications can be downloaded from the developer’s websites or git repositories and installed manually. But be careful when installing.deb
packages from unofficial sources especially if it's not open source.
Downloading Deb Package
For demonstration let's downloadVscodeIDE viawget:
$wget-O'vscode-stable.deb''https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
As you may guess fromquery paramaters
this command will download64 bit architecture ofVscodedeb package from officialVscode repository as namedvscode-stable.deb in your current working directory.
Installing Deb Package
When it comes to installingdeb packages there are command-line or graphical user interface options.
From the command line you have several tools at your disposal as well. In the following sections, I will show you how to useapt
, anddpkg
utilities to install deb packages.
dpkg
dpkg
is a low-level package manager for Debian based systems. Use the-i
or--install
flag to install deb packages withdpkg
.
# First update package indices$sudoapt update# Install via dpkg$sudodpkg-i ./vscode-stable.deb
Unlikeapt
,dpkg
doesn’t resolve dependencies. If you get any dependency errors when installingdeb packages, you can use the followingapt
command to resolve and install all package dependencies:
$sudoaptinstall-f
apt
apt
is a command-line utility for installing, updating, removing, in short managingdeb packages onUbuntu,Debian, and related Linux distributions. It was introduced inUbuntu 14.04 and combines the most commonly used commands fromapt-get
andapt-cache
.
Theapt
package manager will resolve and install all the package dependencies by itself, so it's better to useapt
instead ofdpkg
.
To install localdeb packages withapt
you need to provide the full path to thedeb file. If the file is located in your current working directory instead of typing the absolute path, you should prepend./
before the package
name. Otherwise,apt
will try to retrieve and install the package fromUbuntu’s repositories.
Let's assume you are in the same directory afterwget
tingVscodedeb package, then just simply run:
# First update package indices$sudoapt update# Install via apt$sudoaptinstall ./vscode-stable.deb
Conclusion
We saw how to install localdeb packages on aDebian based distribution —as an example Ubuntu. When installingdeb packages prefer usingapt
since it resolves and install all the package dependencies.
All done!
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse