List All Dependencies of a Deb File
To view information about a “.deb” file and all of its dependencies, run the command below:
The example below shows information about persepolis download manager “.deb” file.
This command is specially useful if you want to check what is being installed beforehand.
List All Files That will be Installed From a Deb Package
To see all files that a “.deb” package will install on your system along with their destination paths, run the command below:
The example below shows files that will be installed on the system if you manually install persepolis download manager “.deb” package. Note that Ubuntu’s apt package manager also lists included files but requires you to install the package first. However, this method doesn’t require you to install the “.deb” package and it is really useful if you want to analyze which file goes where.
Extract All Files from a Deb Package
Sometimes you may want to extract a deb package to check a piece of code or use some of its included files for debugging and other purposes. To extract all files from a deb package, you can run a command in following format:
Note that extracting files is not the same as installation of a deb package. You will just get extracted contents of a “.deb” package in a local folder.
Install a Deb File Using Dpkg
Dpkg is a package management utility for managing “.deb” (debian) packages. To install a “.deb” package using dpkg, run the command below:
The above command will install the standalone deb package only, without any dependencies. To fix this, you will have to run a command to auto-install required dependencies. Otherwise your system may be left in a broken state. To fix the unmet dependency issue, run the command below:
Install a Deb File Using Gdebi
Gdebi is a nice command line and graphical application solely dedicated for installing standalone “.deb” packages stored on your local drive. It automatically resolves dependencies as well, as long as they are available in official Ubuntu repositories (requires network connection).
To install gdebi in Ubuntu, run the command below:
To install a “.deb” package using Gdebi, run the command below:
Since gdebi will take care of installation of dependencies, you don’t have to manually run another command to fix broken packages. However, if you want to check if there are broken packages or not and fix them automatically, you can run the command mentioned above again:
Using Apt to Install a Deb Package
You can also use Ubuntu’s default “apt” package manager to install standalone “.deb” files. To do so, run the following command:
If you launched terminal inside the directory of “.deb” file, run following command instead:
Like gdebi, apt will automatically install all the required dependencies. To confirm, run the command below:
These are a few commands you can use to install “.deb” files without using any graphical interface. They are useful if you are running and managing Ubuntu server edition or using Ubuntu without any desktop environment.