Ubuntu find Dependencies for a package
To find dependencies for a package, run
1 |
apt-cache depends PACKAGE_NAME |
Example
1 2 3 4 5 6 7 |
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.
You can also use
1 |
apt depends PACKAGE_NAME |
To find reverse dependency, run
1 |
apt-cache rdepends PACKAGE_NAME |