Check the dependencies of a package in Ubuntu 20.04 and Debian 10

s2 0

We know that most of the packages we install on our Linux operating system cannot function properly without installing other prerequisite packages. Such prerequisite packages are called dependencies. Sometimes you want to find out the dependencies of a particular package. So today I’m going to show you three ways to check and list the dependencies of a package in Debian 10 and Ubuntu 20.04.

Checking the dependencies of a package in Debian and Ubuntu

To check the dependencies of a package in Debian 10 you can use one of the three methods discussed below:

Method # 1: using the apt show command

To check the dependencies of a particular package with the matching show Command you need to do the following:

Therefore, since all the commands we are going to discuss are passed through the terminal, we need to start the terminal in Debian 10. All we have to do is click the Activities tab in the top left corner of our Debian 10 desktop and then type Terminal in the search bar that appears. Then just click on the terminal search result to launch it in Debian 10 as shown in the following figure:

Now type the following command into your Terminal and then hit Enter:

display the appropriate PACKAGE_NAME

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:

Once this command runs successfully, you can see the dependencies of the specified package along with some other information as highlighted in the following image:

Show package dependencies with the apt show command

Method # 2: using apt-cache depends on the command

To check the dependencies of a particular package with the apt-cache Command in Debian 10 you need to do the following steps:

You need to start the terminal the same way as described in the method above. Now type the following command into your Terminal and then hit Enter:advertising

apt cache depends on PACKAGE_NAME

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 depends on the command

  • Once this command runs successfully, you can see the dependencies of the specified package as highlighted in the following figure:

Show dependencies with apt-cache dependent

Method # 3: using the apt-rdepends command

To check the dependencies of a particular package with the apt-dependent Command in Debian 10 you need to do the following steps:

Again, you need to start the 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, type the following command into your terminal and then press Enter:

sudo apt install apt-rdepends

When you run this command, the apt-rdepends command will be installed on your Debian 10 system. It is shown in the following picture:

Install apt-rdepends

  • During the installation of this command, your system will ask if you want to continue with this installation or not. All you have to do is type “Y” and hit Enter to give your consent, as highlighted in the image below:

Confirm package installation

Once this command is installed, your Debian 10 terminal will look something like this:

apt-rdepends installed successfully

Now type the following command into your Terminal and then hit Enter:

apt-rdepends -r PACKAGE_NAME

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-dependent command

  • This command takes a long time to run because it is supposed to handle all reverse dependencies. Its output is shown in the following figure:

List of package dependencies displayed by the apt-rdepends command

diploma

By 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 follow, but the note here about method # 3 is that you need to be very patient while executing this command.

Check the dependencies of a package in Ubuntu 20.04 and Debian 10