Skip to content

Instantly share code, notes, and snippets.

@metaquanta
Last active November 16, 2017 21:27
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 metaquanta/6b249be06e80170fc3a32725aef7b429 to your computer and use it in GitHub Desktop.
Save metaquanta/6b249be06e80170fc3a32725aef7b429 to your computer and use it in GitHub Desktop.
List packages that don't belong in your distro.
#!/bin/bash
PACKAGE_LIST="dpkg-query -W -f='${binary:Package}\n'" # List all debs
#PACKAGE_LIST=apt-mark showmanual # List only requested/manually installed debs
# Unknown origin debs get 100.
#PRIORITY=100
# I have some preferences to set some repos to other priorities in (100-200)
PRIORITY="1.."
$PACKAGE_LIST | \
xargs apt-cache policy | \
grep -B 4 " \*\*\*.*${PRIORITY}$" | \
grep -v "^ " | \
grep -v -- '^--'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment