How to re-install a package in rescue mode, when chroot fails?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
Issue
- Critical glibc package has been deleted, how can it be reinstalled?
Resolution
- Boot the machine to rescue mode using rescue media (such as the Binary DVD or RHEL.iso)
- Find the location and how is CDROM is recognized by system (eg. /dev/hdc)
- Mount the CDROM to some temporary directory
# mkdir cdtemp
# mount /dev/hdc cdtemp
- Find the package and try to install it manually using RPM.
- In case you are running Linux rescue mode with network support you will be able to download the packages from Customer Portal to another machine then copy them using your network instead mounting a CD:
# scp user@remote-machine-ip:/path/to/packages.rpm /cdtemp
- First execute it in test mode,
# rpm -ivh --test --force --noscripts --root=/mnt/sysimage abc.rpm
- If there are no errors generated, execute it by removing the
–testflag.
# rpm -ivh --force --noscripts --root=/mnt/sysimage abc.rpm abc2.rpm abc3.rpm
Root Cause
- Critical
glibc*orrpmpackages were deleted from the system. - When critical libraries such as glibc are removed it can prohibit a successful chroot. If the system were to chroot successfully, it would be easier to perform a
yum install package,yum reinstall packageoryum localinstall --disablerepo=* /path/to/package.rpm.
Diagnostic Steps
- Review
rpm -Vaoutput to determine if there may be any missing or corrupted OS-required packages
missing /lib64/ld-2.5.so
missing /lib64/ld-linux-x86-64.so.2
missing /lib64/libBrokenLocale-2.5.so
missing /lib64/libBrokenLocale.so.1
missing /lib64/libSegFault.so
missing /lib64/libanl-2.5.so
missing /lib64/libanl.so.1
missing /lib64/libc-2.5.so
missing /lib64/libc.so.6
missing /lib64/libcidn-2.5.so
missing /lib64/libcidn.so.1
missing /lib64/libcrypt-2.5.so
missing /lib64/libcrypt.so.1
missing /lib64/libdl-2.5.so
missing /lib64/libdl.so.2
missing /lib64/libm-2.5.so
missing /lib64/libm.so.6
missing /lib64/libnsl-2.5.so
missing /lib64/libnsl.so.1
missing /lib64/libnss_compat-2.5.so
missing /lib64/libnss_compat.so.2
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
