Skip to content

Instantly share code, notes, and snippets.

@deviantintegral
Created October 2, 2019 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deviantintegral/0ae8b17f2cc3702037990110035ca6b6 to your computer and use it in GitHub Desktop.
Save deviantintegral/0ae8b17f2cc3702037990110035ca6b6 to your computer and use it in GitHub Desktop.
A one-line script that finds installed Debian packages with no reverse dependencies, using multiple processes in parallel
#!/bin/sh
# This list may not be sorted, so if that is desired be sure to pipe the output through sort.
dpkg -l | \
grep '^ii' | \
awk '{ print $2 }' | \
xargs -P4 -I, /bin/sh -c '[ "$(apt-cache rdepends --installed , | wc -l)" = "2" ] && echo ,'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment