How to check .deb Package Dependencies in Ubuntu

Most software or application in Ubuntu, does not come as one package and it depends on other packages to work as intended. These supporting packages are called dependency packages as they are required for the proper working of the software. Usually, the package manager in your system automatically resolves these dependencies, but sometimes an issue or error occurs and you have to resolve the issue manually.

In that case, it is better to have a detailed picture of the dependencies of the package so that you can locate the issue easily. Therefore, You will learn how to check the dependencies of any package in this article.

Check
Sponsored
Dependencies Using APT Package Manager

You can use the apt package manager depends command to list down the dependencies associated with any particular package. For example, run the following command to see the dependencies of the vlc package.

sudo apt depends vlc

You can also use the following apt-cache command to get a similar result.

sudo apt-cache depends vlc

If you want more detailed information about package dependencies, run the following apt show command.

sudo apt show vlc

Similarly, you can use the apt-cache show command to get more comprehensive information about package dependencies.

sudo apt-cache show vlc

Check Dependencies Using Debian Package Manager (dpkg)

If you have to install any software from a deb file, you can check its dependencies by running one of the following commands.

sudo dpkg -I /path/to/package.deb
sudo dpkg --info /path/to/package.deb

Note: Replace /path/to/package with your deb file path before running the above command.

The above commands will show the dependencies even before the .deb package is installed. But if you want to check the dependencies of an already installed package, run the following command with your package name.

sudo dpkg -s firefox

Check Dependencies Using apt-rdepends Utility

apt-rdepends is a utility that can help you list down the package dependencies. You can install it by using the following command.

Sponsored
sudo apt install apt-rdepends

To see the dependencies tree, run the following command with your package name.

sudo apt-rdepends packagename

You can also get information about packages that are dependent on a particular package with the following command.

sudo apt-rdepends -r vlc-bin

Check Dependencies Using reverse-depends Utility

Reverse-depends is a utility that provides information about the dependent packages. You can install it by running the following command.

sudo apt install ubuntu-dev-tools

To list down the direct dependencies of the package, run the following command with your package name.

sudo reverse-depends -R vlc

Check Dependencies Using Simulated Installation/Uninstallation

You can use the -s option with the apt command to simulate the installation and uninstallation of any package to see the dependencies installed during the installation.

sudo apt install -s vlc

sudo apt remove -s php

Conclusion

Ubuntu/Linux packages are interdependent as they are designed to complete a single task. This article shows how you can see the package dependencies.

It is beneficial to know what packages are required or are being installed during software installation as it gives you more clarity over the installation process. It also helps you debug your installation process in case of an error.

The post How to check .deb Package Dependencies in Ubuntu appeared first on FAQforge.

Ubuntu Server Admin

Recent Posts

How to Fix VMware’s “Could not open /dev/vmmon” Error on Ubuntu

You’ve recently installed VMware Workstation on your Ubuntu system and encountered the frustrating “Could not…

5 hours ago

How to Fix Ubuntu 404 Errors While Fetching Dependencies

Have you ever found yourself staring at a terminal full of 404 errors while trying…

5 hours ago

How to Fix ‘Please Install All Available Updates’ Error When Upgrading Ubuntu 18.04 to 20.04 LTS

One particularly frustrating error that many users face when trying to upgrade from Ubuntu 18.04 …

5 hours ago

How to fix “Release is not valid yet” Error in Docker Containers

In the world of containerization, time synchronization issues can create unexpected roadblocks when working with…

5 hours ago

How to fix “Externally Managed Environment” Pip Errors on Ubuntu

If you’ve recently upgraded to Ubuntu 23.04 or newer, you might have encountered a frustrating…

5 hours ago

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI…

12 hours ago