2

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?

muru
  • 197,895
  • 55
  • 485
  • 740

3 Answers3

4

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.

muru
  • 197,895
  • 55
  • 485
  • 740
  • And can I at the same time view which programs they were installed by? –  Aug 05 '15 at 17:32
  • @ParanoidPanda at the same time? Doubtful. You can try aptitude why on these packages. – muru Aug 05 '15 at 17:33
  • 1
    How about something along the lines of for 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:46
  • 1
    @ParanoidPanda adapting on Malte's suggestion: apt-mark showauto | xargs -n1 aptitude why – muru Aug 05 '15 at 17:53
2

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
A.B.
  • 90,397
1

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.

Ramon Suarez
  • 1,841