#!/bin/bash # GPLv3+ see COPYING.GPL FOO=`which $1` for x in `ldd $FOO | awk -F' ' '{print $3}' | grep -i '/'` ; do dpkg -S $x >> /tmp/mydeps; done ; cat /tmp/mydeps | awk -F':' '{print $1}' | sort | uniq; rm /tmp/mydeps;