Ubuntu Pastebin

Paste from paelzer at Tue, 28 Mar 2017 12:18:33 +0000

Download as text
1
2
3
4
5
6
7
#!/bin/bash
tmp=$(mktemp)
# or from dpkg --get-selections
packages=$(dpkg -l | awk '/^ii/ {gsub(":.*",""); print $2}' | xargs)
apt-cache policy ${packages} | awk '/^[a-zA-Z1-9-]*:/ {gsub(":",""); pkg=$1} /archive/ {printf("%s\t%s\n", $3, pkg)}' | sort | uniq > ${tmp}
cat ${tmp}
cut -f 1 ${tmp} | uniq -c
Download as text