打破/ lib64,可挽救? (ubuntu的/ mint12)

在错误地尝试用debugging符号重新编译ld时,我最终得到了一个/ lib64而不是/ lib(Debian 64位libs位于/ lib / x84_64-linux-gnu中)。 我试图重新安装libc6使用apt ,这错误抱怨上述。

我(错误地)认为我可以只是mv /lib64 /tmp && ln -s /lib /lib64 ; 第一个命令工作,留下一个破碎的系统( /bin/ld not found等)。

有什么办法可以解决这个问题吗? (即不运行救援盘)

如果我可以匿名发布,我会… [叹气]

不知道这是否会帮助其中的一部分,但如果你发现你已经移动了运行时链接程序,以使诸如mv,cp,ln,rm之类的东西不再起作用,那么仍然可以运行它们(并希望能够拯救自己)通过显式指定运行时链接程序。 例如

     mv / lib64 / tmp
     ln -s / lib / lib64#失败,没有运行时连接器
     /tmp/lib64/ld-2.13.so / bin / ln -s / lib / lib64#应该成功

如果其他人有这个问题, 一旦我使用恢复光盘将文件放回原属于的位置,以下脚本允许我重新安装libc:

 #!/bin/bash # Fix symlinks in a b0rked /lib64 (Debian). # Libs in /lib64 should be symlinked to /lib/x86_64-linux-gnu; # if a symlink is found in /lib64, try to redirect it to a # file of the same name in /lib/x86_64-linux-gnu. # Then remove the old symlink destination. # # The Problem: # me@box # ls -l /lib64 # -rwxr-xr-x 1 root root 156683 2011-12-29 19:11 ld-2.13.so # lrwxrwxrwx 1 root root 10 2011-12-29 19:11 ld-linux-x86-64.so.2 -> ld-2.13.so # # The Solution: # lrwxrwxrwx 1 root root 10 2011-12-29 19:11 ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.13.so # set -e libs=(/lib64/*) bak=$HOME for l in ${libs[@]}; do src=$(ls -l $l |awk '{print $10}'); if [[ ! -z "$src" ]]; then if [[ ! -f "/lib64/$src" ]] || [[ ! -f "/lib/x86_64-linux-gnu/$src" ]]; then echo "error: $l src or dest not found:" echo `ls -l "/lib64/$src"` > /dev/null echo `ls -l "/lib/x86_64-linux-gnu/$src"` > /dev/null continue fi ln -si "/lib/x86_64-linux-gnu/$src" "$l"; mv "/lib64/$src" $bak/; fi done