Skip to content

Instantly share code, notes, and snippets.

@rickumali
Last active April 12, 2023 00:19
Show Gist options
  • Save rickumali/7353a21591db281d3d62089b0534d614 to your computer and use it in GitHub Desktop.
Save rickumali/7353a21591db281d3d62089b0534d614 to your computer and use it in GitHub Desktop.
Describes All Packages on Your Debian

Instructions

% ./package-info.sh > packages.txt
Generated rasp-pi-20230411-200532.txt
% wc rasp-pi-*.txt
 1417  1417 23563 rasp-pi-20230411-200532.txt

Run the script and redirect its output to get apt-cache show information on each package.

The script also generates a file rasp-pi-YYYYMMDD-HHMMSS.txt containing all the packages that have been installed (one package per line).

On my system, this script takes 5-6 minutes to run.

YouTube

This script was described in:

https://youtube.com/live/OyfIQFVps5M (No 1) https://youtube.com/live/uMm1DQX2J5Y (No 2)

filename=rasp-pi-$(date +%Y%m%d-%H%M%S).txt
dpkg --get-selections |sed -n 's/\t\+install$//p' > $filename
printf "Generated $filename\n" 1>&2
count=1
cat $filename |
while read p
do
echo "$count - $p"
(( count += 1 ))
sudo apt-cache show $p
echo "--------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment