How to install deb file in Ubuntu 24.04 using terminal? This tutorial explains on Ubuntu, how to install deb with dependencies via command line.
What is Deb Package?
A Debian “package”, or a Debian archive file, contains the executable files, libraries, and documentation associated with a particular suite of program or set of related programs. Normally, a Debian archive file has a filename that ends in .deb.
A Debian “package” generally contain all of the files necessary to implement a set of related commands or features.
For UNIX based systems, there are two types of Debian packages:
- Binary packages, which contain executables, configuration files, man/info pages, copyright information, and other documentation. These packages are usually characterized by having a ‘.deb’ file extension.
- Source packages, which consist of a .dsc file describing the source package, a .orig.tar.gz file that contains the original unmodified source in gzip-compressed tar format.
Installation of Debian “package” uses “dependencies” which are documented in the control file associated with each Debian “package”.
You can use “dpkg-query -l” command to list all the installed packages in Debian and Ubuntu.
1. Install deb files using dpkg Package Manager
The dpkg is one of the widely used tools to install .deb files on Linux Ubuntu Systems.
The dpkg is the package manager for Debian. The dpkg tool is used to install, build, remove and manage Debian packages.
Users can run the following command to install deb package:
sudo dpkg -i /path/package_name.deb
In some cases you may get dependency error while installing the deb package. In such case, run the following command to install the pending dependencies alongwith the deb package:
sudo apt-get install -f
2. Install deb files using apt
The apt is the default package manager and is one of the easiest ways to install a deb package. You can the run the following commands to install deb package using apt:
sudo apt install /path/package_name.deb
3. Terminal Method using GDEBI Package Manager
The gdebi is a simple tool to install deb files. gdebi lets you install local deb packages resolving and installing its dependencies.
Note that the apt tool does the same, but only for remote (http, ftp) located packages. It can also resolve build-depends of debian/control files.
You must know that the gdebi package manager is not installed by default in Ubuntu. You will have to install it manually using the command “sudo apt install gdebi”.
Once the gdebi tool is installed, you can easily install deb files.
To install a deb file using gdebi, run the following command:
sudo gdebi /path/package_name.deb
You can also install deb files using GUI method.