更换libc.so导致linux变砖,通过LD_PRELOAD挽救

操作记录:

root@Linx:/home/work# ldconfig -p | grep 'libc.so'

libc.so.6 (libc6,x32, OS ABI: Linux 3.4.0) => /libx32/libc.so.6

libc.so.6 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib/x86_64-linux-gnu/libc.so.6

libc.so.6 (libc6, OS ABI: Linux 2.6.32) => /lib32/libc.so.6

root@Linx:/home/work#

root@Linx:/home/work# cp libc.so.6 /usr/local/lib64/

root@Linx:/home/work# ldconfig

root@Linx:/home/work# ls

ls: relocation error: /usr/local/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

root@Linx:/home/work# rm /usr/local/lib64/*

rm: relocation error: /usr/local/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

root@Linx:/home/work# LD_PRELOAD=/lib/x86_64-linux-gnu/libc.so.6 rm /usr/local/lib64/*

root@Linx:/home/work# LD_PRELOAD=/lib/x86_64-linux-gnu/libc.so.6 rm /usr/local/lib64/*

rm: 无法删除"/usr/local/lib64/*": 没有那个文件或目录

root@Linx:/home/work# ldconfig

root@Linx:/home/work# ls

libc.so.6 libstdc++.so.6.0.28

root@Linx:/home/work# ll

总用量 3700

-rw-r--r-- 1 root root 1828080 9月 24 2024 libc.so.6

-rw-r--r-- 1 root root 1956992 9月 9 23:06 libstdc++.so.6.0.28

root@Linx:/home/work#

相关推荐
未济4 天前
linux 配置环境变量
linux
傲世仙尊4 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫4 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
_艾伦 耶格尔.4 天前
进程间通信
linux
Liuqy-054 天前
Linux IO编程——静态库、动态库
linux
彧azz4 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅4 天前
linux(8) 软硬链接
linux·运维·服务器
Wang's Blog5 天前
Java 项目实战: 外卖平台-文件下载与ServletOutputStream回写浏览器
服务器·项目开发
AIgorithmGEEK5 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖5 天前
SimlpeHttp
linux·服务器