3

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
  • 207,228

4 Answers4

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
  • 207,228
3

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.
  • 92,125
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,861
0

In recent versions of Ubuntu (I'm on 22.04) you can just run:

apt list --installed | grep installed.automatic

or use grep -v installed.automatic to see the ones that you installed. EDITING: Acutally, it looks like "installed,upgradable" can eventually replace automatic, making this less useful. Not sure why it is not just added as an additional field....