Check package dependencies on Ubuntu 20.04 and Debian 10

We know that most of the packages we install on our Linux operating system cannot work properly without other required packages installed. Such required packages are called dependencies. Sometimes you want to know the dependencies of a particular package. So today I will show you three ways to check and list package dependencies on Debian 10 and Ubuntu 20.04.

Checking package dependencies on Debian and Ubuntu

To check package dependencies on Debian 10, you can use any of the three methods described below:

Method # 1: Using the apt show command

To check the dependencies of a specific package using good show , you will need to follow the steps given below:

Since all the commands we are going to discuss are passed through the terminal, we will need to start the terminal in Debian 10. All we have to do is click the Actions tab in the upper left corner of our Debian 10. desktop and then write terminal in the displayed search bar. Then just click on the terminal search result to run it on Debian 10, as shown in the following image:

Now enter the following command in your terminal and hit the Enter key:

apt show PACKAGE_NAME

Here, replace PACKAGE_NAME with the name of the package whose dependencies you want to find out. In this example, we wanted to check the dependencies of the zlib1g package using the apt show command in Debian 10. So we replaced PACKAGE_NAME with zlib1g as shown in the image below:

apt show command

Once this command is successfully executed, you should be able to see the dependencies of the specified package along with some other information, as shown in the following image:

Displaying package dependencies with apt show command

Method # 2: using the apt-cache plays command

To check the dependencies of a specific package using apt-cache on Debian 10, you will need to follow these steps:

You need to start the terminal in the same way as described in the method above. Now enter the following command in your terminal and hit the Enter key:

apt-cache depends on PACKAGE_NAME

Here, replace PACKAGE_NAME with the name of the package whose dependencies you want to find out. In this example, we wanted to check the dependencies of the zlib1g package using the apt-cache command in Debian 10. So we replaced PACKAGE_NAME with zlib1g as shown in the image below:

apt-cache command depends

  • Once this command is successful, you should be able to see the dependencies of the specified package as shown in the following image:

Show dependencies with apt-cache depends

Method # 3: using the apt-rdepends command

To check the dependencies of a specific package using apt-rdepends on Debian 10, you will need to follow the steps given below:

Again, you need to start a terminal as described in the method above. After successfully launching the terminal, you will need to install the apt-rdepends command on your Debian 10 system as it is not enabled by default. To install it, enter the following command in the terminal and press the Enter key:

sudo apt install apt-rdepends

Running this command will install the apt-rdepends command on your Debian 10 system. This is shown in the following image:

Install apt-rdepends

  • During the installation of this command, your system will ask you if you want to proceed with this installation or not. You just need to enter “Y” and press the Enter key to confirm your consent, as shown in the image below:

Confirm package installation

After completing the installation of this command, your Debian 10 terminal should look something like this:

apt-rdepends installed successfully

Now enter the following command in your terminal and hit the Enter key:

apt-rdepends -r PACKAGE NAME

Here, replace PACKAGE_NAME with the name of the package whose dependencies you want to find out. In this example, we wanted to check the dependencies of the zlib1g package using the apt-rdepends command in Debian 10. So we replaced PACKAGE_NAME with zlib1g as shown in the image below:

apt-rdepends command

  • This command will take a long time to run because it has to handle all inverse dependencies. Its result is shown in the following image:

List of package dependencies displayed by apt-rdepends command

Conclusion

Using any of the three methods described in this article, you can easily find the dependencies of any package you want in Debian and Ubuntu. All of these methods are fairly simple and easy to use, but there is a point to note here for method # 3: you will need to be very patient while this command is being executed.

Check package dependencies on Ubuntu 20.04 and Debian 10

Related Posts