Skip to content

Instantly share code, notes, and snippets.

@fumiyas
Last active February 24, 2023 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fumiyas/fced82cbb4de6704dcf7af4cbc218e36 to your computer and use it in GitHub Desktop.
Save fumiyas/fced82cbb4de6704dcf7af4cbc218e36 to your computer and use it in GitHub Desktop.
#!/bin/sh
rpm -qa --queryformat '%{name}\n' "$@" \
|xargs rpm -qR \
|grep -E -v '^(lib[^(]+\.so(\.[0-9]+)+\([^)]|(config|rpmlib)\()' \
|sort -u \
|xargs yum provides --disablerepo='*' --cacheonly --noplugins \
|sed -n -e '/./{ H; $! d; }' -e 'x; s/^\n//; s/^[0-9]*://; s/\n.*//; s/\s*: .*//; p;' \
|sort -u \
|xargs rpm -q --queryformat '%{name} %{version} %{release} %{arch}\n' \
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment