Last active
March 30, 2017 17:25
-
-
Save i80and/5258304a693895c3e3fc to your computer and use it in GitHub Desktop.
Extracts the RPM package dependencies for a directory of executables, prefering 64-bit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getdeps_rpm() { | |
for dep in $(readelf -d ./* | grep NEEDED | awk '{print $5}' | cut -c 2- | rev | cut -c 2- | rev | sort | uniq); do | |
rpm -qf "/usr/lib64/${dep}" 2>/dev/null || rpm -qf "/lib64/${dep}" 2>/dev/null || rpm -qf "/usr/lib/${dep}" 2>/dev/null || rpm -qf "/lib/${dep}" | |
done | sort | uniq | rev | cut -d - -f 1-2 --complement | rev | |
} | |
getdeps_deb() { | |
for f in $(readelf -d ./* | grep NEEDED | awk '{print $5}' | cut -c 2- | rev | cut -c 2- | rev | sort | uniq); do | |
apt-file search "$f" | |
done | cut -d ':' -f 1 | sort | uniq | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment