This is a repost from Stack Overflow, considering this site could be a better target.
After a Fedora distro upgrade (27->28) with
dnf, I tried to manually resolve conflicts between package versions (needed to keep older OS versions functional; effective OS version is selected at boot time in GRUB2 menu).
dnf security checks prevented the removal of conflicting packages and I used
rpm -e xxx --force to do that. I inadvertantly removed glibc and the PC immediately errored out.
I want to avoid rebuilding my computer from scratch because
- I don't exactly remember all applications I installed years ago (they were automatically upgraded by dnf system-upgrade)
- there would be a huge configuration work in /etc to restore custom settings for my network environment plus the servers on the machine
Using a rescue disk, I could boot and examine the hard disk. Everything seems relatively "clean". Files from glibc package are simply missing.
I could not complete
chroot to the former root (in order to run
rpm -i glibc) because
chroot tries to launch
/bin/bash which is missing.
I found How do I extract the contents of an rpm? on StackOverflow but this does not answer my question because I want what rpm would do but in another "root".
Is there a way to tell rpm to do its usual job but to install files in, say,
/mnt/hard_disk/ instead of
I'll take care afterwards of package database consistency and integrity.