Skip to content

Instantly share code, notes, and snippets.

@malyzeli
Last active November 10, 2019 16:16
Show Gist options
  • Save malyzeli/417dc5fcf9d2a5c0221be8bf9c4bdd5e to your computer and use it in GitHub Desktop.
Save malyzeli/417dc5fcf9d2a5c0221be8bf9c4bdd5e to your computer and use it in GitHub Desktop.
List explicitly installed packages on Ubuntu
# Filters packages installed by system using logs from `/var/log/installer/initial-status.gz`
# source: https://unix.stackexchange.com/a/80520
comm -13 \
<(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort) \
<(comm -23 \
<(dpkg-query -W -f='${Package}\n' | sed 1d | sort) \
<(apt-mark showauto | sort) \
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment