In this write-up, we will explore different ways to find out the dependencies of the newly going install package.
How to check dependencies of a package in Ubuntu 22.04
We can check the dependencies by the below-mentioned methods:
- By using the apt command
- By using the dpkg command
- By installing a third-party tool
Method 1: Checking dependencies of a Package in Ubuntu 22.04 by using the apt command
The apt is a default package manager that is used to install, manage, and delete the applications from Ubuntu. The apt package manager can be used to display the dependencies of any package which is to be installed, for example, we want to find out the dependencies of the LibreCAD, we will use the command:
The above command tells us about the information of the package also like the origin and priority, but if you want to display only the package dependencies, then we will use the command:
The above command displayed the to-the-point results.
Method 2: Checking dependencies of a Package in Ubuntu 22.04 by using the dpkg command
If we want to know the package dependencies of the Debian or deb package, then we will use the dpkg package manager with the “I” flag to find out the package dependencies, for example, we will use the command to find out the details of the package dependencies of the teamviewer deb package:
Method 3: Checking dependencies of a Package in Ubuntu 22.04 by installing a third-party tool
There are a number of third-party packages which are used to find out the dependencies of the different packages, one of these packages is known as the “apt-rdepends” tool. To use the apt-rdepends, we have to first install it by using the apt package manager:
Now we will use the installed package of apt-rdepends to find out the dependencies of the VLC media player using the command:
Conclusion
Package dependencies are important for the package to function properly. There are various ways to check package dependencies in Ubuntu and in this guide, we have discussed 3 methods to find out all dependencies of any specific package.