For each package I have installed I would like to know which packages would be installed if I uninstall it. An example of the output I need is (package: list of deps
):
abc: foo bar
bcd: baz abc
bdd: baz fuubar
Append
If I check what really would be removed if I remove the package ppp
using apt-get
:
$ echo $(apt-get --dry-run remove ppp | grep '^Remv ' | cut -d' ' -f2)
gnome-ppp mint-meta-xfce network-manager-pptp-gnome network-manager-pptp wvdial pppoeconf pppoe pptp-linux pppconfig ppp
I see that it is different from what apt-cache
show gives me (which I do not think include recursive dependencies):
$ apt-cache show ppp | grep '^Breaks: '
Breaks: network-manager (<= 0.8.0.999-1), network-manager-pptp (<= 0.8.0.999-1), pppdcapiplugin (<= 1:3.9.20060704+dfsg.1-1)
Append 2
Is dpkg --get-selections | cut -f1
a reliable way to get a list of installed packages to iterate over?
apt-get --dry-run remove
looks basically right. It might miss some automatically installed packages that are only needed for automatically installed packages that are only needed by the package you remove. Is that why you don't consider it a suitable answer?