1

I am not aware of another way to do this - if that program has been already installed (not like those installed after installing a specialized program like debfoster) - unless I have saved the message given by apt or apt-get: for example for Thunar it said:

The following additional packages will be installed:
  exo-utils libexo-1-0 libexo-common libexo-helpers libgarcon-1-0
  libgarcon-common libthunarx-2-0 libtumbler-1-0 libwnck-common libwnck22
  libxfce4ui-1-0 libxfce4ui-common libxfce4util-bin libxfce4util-common
  libxfce4util7 libxfconf-0-2 thunar-data thunar-volman tumbler tumbler-common
  xfce4-panel xfconf

Are such information already available in Ubuntu without installing a separate tool like debfoster? So, I am not asking about such tools (as answered here), but about a way to see packages that came with programs already installed through apt or apt-get.

3 Answers3

1
apt-cache rdepends thunar

gives you the dependencies of the program..

Or look in /var/log/apt/history.log which would give you the exact list information you are after.

References: How to list dependent packages (reverse dependencies)?

pomsky
  • 68,507
Ray T
  • 11
  • Great. I have to chose a definitive answer and I chose the other one because it gives a list that is easy to copy-paste. –  Jan 11 '18 at 21:23
  • As for the link posted on reverse dependencies, reverse is not what is asked here. apt-cache rdepends seems to list programs that depend upon a given program, and not the packages upon which the latter depends and were installed by it. For example, it shows for pcmanfm programs like lubuntu-core which I think needpcmanfm but are not needed by it. –  Jan 11 '18 at 22:25
1

Provided you have not installed anything in the meantime that shares any of the same dependencies, then one way would be to simulate removal of the package and take note of the automatically installed packages:

e.g.

$ sudo apt-get remove --dry-run thunar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  exo-utils libexo-1-0 libexo-common libexo-helpers libgarcon-1-0 libgarcon-common libthunarx-2-0 libtumbler-1-0 libwnck-common libwnck22 libxfce4ui-1-0
  libxfce4ui-common libxfce4util-bin libxfce4util-common libxfce4util7 libxfconf-0-2 thunar-data tumbler tumbler-common xfce4-panel xfconf
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  thunar thunar-volman
0 upgraded, 0 newly installed, 2 to remove and 123 not upgraded.
Remv thunar-volman [0.8.1-2]
Remv thunar [1.6.11-0ubuntu0.16.04.2]

NOTE: if there are other pending autoremovals (commonly, these are kernel packages resulting from automatic security updates) these will also show up in the output. In order to see only the automatically installed packages for the specific package you are interested in, run sudo apt-get autoremove first so that apt starts from a "clean" state.

steeldriver
  • 136,215
  • 21
  • 243
  • 336
  • you mean "note the list of automatic dependencies", yes? –  Jan 11 '18 at 21:10
  • That is exactly what I was looking for, as the dependencies mentioned after the command can be copied/pasted in order to remove them. But that info is given anyway by apt-get (by apt too?) with just the remove argument, only the --dry-run is safer. –  Jan 11 '18 at 21:17
  • I see it sometimes shows some packages that surely didn't come with the specific program (linux-headers-4.10.0-28-generic linux-image-4.10.0-28-generic linux-image-extra-4.10.0-28-generic). Looking up /var/log/apt/history.log as said in the other answer may be better in a such case. –  Jan 11 '18 at 21:21
  • 1
    @cipricus it will probably work better if you run sudo apt-get autoremove before simulating the specific package removal - so the result isn't confused by other pending autoremovals – steeldriver Jan 11 '18 at 21:25
0

apt-rdepends will take the package name and tell you the dependent packages of the package, which are supposed to be installed or satisfied when you apt-get install it.

guntbert
  • 13,134
  • what exactly is the command to see additional packages that came with let's say pcmanfm? –  Jan 11 '18 at 20:40
  • apt-rdepends pcmanfm – Jiashun Zheng Jan 11 '18 at 20:46
  • 1
    It seems to show the dependencies. But some of those could have come with the system and be already installed when the given program was installed. I am looking only for the additional dependencies that came with a program (in order to unistall them along with it). Is the command above showing those? –  Jan 11 '18 at 20:53
  • Answer provide by @steeldriver should be the one you are looking for. You want to apt-get autoremove first to remove any other packages first and try the: apt-get remove --purge -s pcmanfm – Jiashun Zheng Jan 11 '18 at 21:14