Ubuntu find Dependencies for a package

To find dependencies for a package, run

apt-cache depends PACKAGE_NAME

Example

root@ubuntu-s-4vcpu-8gb-nyc1-01:~# apt-cache depends php7.2
php7.2
 |Depends: libapache2-mod-php7.2
 |Depends: php7.2-fpm
  Depends: php7.2-cgi
  Depends: php7.2-common
root@ubuntu-s-4vcpu-8gb-nyc1-01:~#

In above example, when you install php7.2, it install “libapache2-mod-php7.2”, that will install Apache web server. I had a server with ngtinx, when i install php7.2 package, apache get installed.

Advertisement

You can also use

apt depends PACKAGE_NAME

To find reverse dependency, run

apt-cache rdepends PACKAGE_NAME

apt-cache
apt

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement