Skip to content

Instantly share code, notes, and snippets.

View Nicholas-Baron's full-sized avatar

Nicholas Baron Nicholas-Baron

View GitHub Profile
#!/bin/sh
dpkg -l | grep '^ii' | tr -s ' ' | cut -f2 -d' ' | sed 's/:amd64$//g' | sort -u > dpkg.txt
@Nicholas-Baron
Nicholas-Baron / update_lists.sh
Last active February 26, 2020 19:13
A script to generate two lists of packages
#!/bin/sh
auto_count=$(apt-mark showauto | sort -u | tee auto.txt | wc -l)
manual_count=$(apt-mark showmanual | sort -u | tee manual.txt | wc -l)
total_count=$(cat auto.txt manual.txt | sort -u tee all.txt | wc -l)
printf "\t%d manually installed and %d automatically installed\n\t%d in total\n" "$manual_count" "$auto_count" "$total_count"