I had this problem on my LAMP server. I was making *yum update* as normaly. The update process was not ended sucssesfully because xz-libs-5.1.2-12alpha.el7 RPM was doing conflict with the new one xz-libs-5.2.2-1.el7 RPM. So i decided to remove xz-libs-5.1.2-12alpha.el7.x86_64.rpm and than redo the updates.
$: rpm -e xz-libs-5.1.2-12alpha.el7.x86_64.rpm --nodeps
After removing that my LAMP server did not respond to any command at all. The message i get, was:
$:Error: liblzma.so.5: cannot open shared object file: No such file or directory
The solution i did, was downloading the package on my computer, attaching the CentOS 7.2 DVD to the server, putting the RPM package to a USB and booting the server in rescue mode from the DVD and than mounting the USB.
Than copying the rpm to a folder inside the LAMP and extracting the RPM package files without installing it. The two files obtained “ liblzma.so.5 and liblzma.so.5.0.99” copying to the exact path they were befere. Than rebooting the LAMP server and was up and running like before.
$: mkdir /mnt/usb
$: lsblk (to see with dev partition is the usb)
$: mount /dev/sdb1 /mnt/usb
$: mkdir /tmp/xz-libs
$: cp /mnt/usb/ xz-libs-5.1.2-12alpha.el7.x86_64.rpm /tmp/xz-libs
$: cd /temp/xz-libs
$: rpm2cpio xz-libs-5.1.2-12alpha.el7.x86_64.rpm | cpio -idmv
$: cd /usr/lib64/
$: cp liblzma.so.* /mnt/sysimage/usr/lib64/
$: reboot