Skip to content

Instantly share code, notes, and snippets.

@bigntallmike
Last active November 17, 2023 22:11
Show Gist options
  • Save bigntallmike/0624858d4eead91d90baebfee4dcb94d to your computer and use it in GitHub Desktop.
Save bigntallmike/0624858d4eead91d90baebfee4dcb94d to your computer and use it in GitHub Desktop.
Steps to reinstall RPMs with zero-length libraries
# With root file system mounted at /oldsys:
# Use at own risk!!
find /oldsys/usr/lib -size 0 >/tmp/badlibs
cat /tmp/badlibs \
| xargs --replace={} rpm --root /oldsys -qf "{}" \
| grep -v "not owned" \
| sort \
| uniq \
| xargs dnf -y --installroot=/oldsys reinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment