Skip to content

Instantly share code, notes, and snippets.

@manavid
Created Mar 15, 2013
Embed
What would you like to do?
#!/bin/bash
RESULT=$(find $@ -type f -perm /a+x -exec ldd {} \; \
| grep so \
| sed -e '/^[^\t]/ d' \
| sed -e 's/\t//' \
| sed -e 's/.*=..//' \
| sed -e 's/ (0.*)//' \
| sort \
| uniq \
| sort -n)
packages=""
for f in $RESULT; do
package=$(dpkg -S $f 2>/dev/null | cut -d: -f1 | cut -d':' -f1)
#echo $package
packages="$packages\n$package"
done
packages=$(echo -e $packages | sort | uniq | sort -r)
echo ------------------------------------ Packages -----------------------------
echo -e $packages
echo ------------------------------------ Deps ---------------------------------
echo
deps=""
for p in $packages; do
dep=$(apt-show-versions -p $p | cut -d' ' -f3 | cut -d: -f2 | cut -d- -f1)
echo "$p: $dep"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment