Tuesday, February 25, 2020
extracting filenames from packages available in debian
I wound up using
apt-file data to see what binaries are available from Debian
packages, and I’ve referenced the list of files I generated then a bunch of
times since. It’s obviously way out of date by now, and today I had a similar
question to answer, so here’s a scripted version of that process that worked on
my current machine, running Debian Buster:
#!/bin/sh # Make sure we've got apt-file and lz4 compression utils: sudo apt install apt-file lz4 # Update lists: sudo apt-file update cd /var/lib/apt/lists lz4cat ./*.lz4 | \ grep -E '^(usr/bin/|sbin/|bin/)' | \ cut -f1 -d' ' | \ perl -pe 's/^(.*)\/(.*)$/$2/' | \ sort | uniq > ~/used_names.txt
Then you can
grep whatever ~/used_names.txt to look for binaries.
The main difference here is that the contents lists are now in
/var/lib/apt/lists, as LZ4-compressed files named like
I haven’t taken the time to investigate whether this data is still just loaded
apt-file’s benefit or is in some way more integrated with
apt or what.
Maybe I’ll revisit at some point.
Today’s used_names.txt is attached to this post just in case it’s helpful to people coming in from web search.