#!/bin/bash # get_debian_sections: Extracts the sections from the dpkg status file extract_sections() { file_base="$1" cut -d\ -f2 | sed 's/.*\///' | uniqoc | sort -rn | tee "$file_base.txt" | kut 2 | sort > "${file_base}_sort.txt" } < /var/lib/dpkg/status grep '^Section:' | extract_sections "sections_my" cat /var/lib/apt/lists/*_Packages | grep '^Section:' | extract_sections "sections_all" comm sections_my_sort.txt sections_all_sort.txt -3 -1 | tee sections_untried\!.txt