Is there a way in Terminal to list all programs which have not been installed by me, but other programs as necessary dependencies? And can I at the same time view which programs they were installed by?
3 Answers
Closely related to: Generating list of manually installed packages and querying individual packages
Use:
apt-mark showauto
This lists automatically installed packages, as opposed to manually installed packages.
Using aptitude
a high-level interface to the package manager, but you have to install it first
sudo apt-get install aptitude
After that
aptitude search '?installed(?automatic)'
to see a list of automatically installed packages.
And to see at the same time which programs they were installed by:
Only
Depends
aptitude -F %p search '?installed(?automatic)' | \ while read x ; do aptitude why "$x" | awk '/Depends/' ; done
Or the full list
aptitude -F %p search '?installed(?automatic)' | \ while read x ; do aptitude why "$x"; done
Sample output
i texlive-full Depends lcdf-typetools
i A lcdf-typetools Depends aglfn
i python3-apparmor-click Depends apparmor-easyprof
i aptitude Depends aptitude-common (= 0.6.11-1ubuntu3)
i arronax Depends arronax-base
i arronax Depends arronax-nautilus
i ubuntu-dev-tools Depends devscripts (>= 2.11.0~)
i lxc-docker Depends lxc-docker-1.7.1
i gnome-common Depends autopoint
i A nvidia-prime Depends bbswitch-dkms
i calibre Depends python-pil | python-imaging
i A python-pil Depends mime-support | python-pil.imagetk
i A python-pil.imagetk Depends python-tk (>= 2.7.7-2)
i A python-tk Depends blt (>= 2.4z-9)
i bluegriffon Depends bluegriffon-data (= 1.7.2-1~getdeb2~raring)
i playonlinux Depends cabextract

- 90,397
-
That gives me the description of the dependencies in addition, however does not appear to show which application installed it. – Aug 05 '15 at 17:36
-
-
I made an improvement to it, however I did it before you posted your answer, so I assumed that you had seen my edits. – Aug 05 '15 at 17:56
-
Use this pipe in your command line: apt list --installed | xargs apt-cache showpkg > dependencies.txt
. Beware it will take long and use all your cpu. I piped it to a file because it is a very long list. The first part of the pipe provides all installed packages, the second part takes each one of them and looks for their dependencies.

- 1,841
aptitude why
on these packages. – muru Aug 05 '15 at 17:33for i in $(apt-mark showauto); do aptitude why "$i"; done
? ;-) Admittedly, the output is rather confusing (though that's easily remedied), and it will take a hell of a long time... – Malte Skoruppa Aug 05 '15 at 17:46apt-mark showauto | xargs -n1 aptitude why
– muru Aug 05 '15 at 17:53