Accidentally Deleted Symlink Libc.So.6 in Centos 6.4. How to Get Sudo Privilege to Re-Create It

How to recover after deleting the symbolic link libc.so.6?

You could simply run ldconfig. Most distributions ship this as a static binary.

Multiple glibc libraries on a single host

It is very possible to have multiple versions of glibc on the same system (we do that every day).

However, you need to know that glibc consists of many pieces (200+ shared libraries) which all must match. One of the pieces is ld-linux.so.2, and it must match libc.so.6, or you'll see the errors you are seeing.

The absolute path to ld-linux.so.2 is hard-coded into the executable at link time, and can not be easily changed after the link is done (Update: can be done with patchelf; see this answer below).

To build an executable that will work with the new glibc, do this:

g++ main.o -o myapp ... \
-Wl,--rpath=/path/to/newglibc \
-Wl,--dynamic-linker=/path/to/newglibc/ld-linux.so.2

The -rpath linker option will make the runtime loader search for libraries in /path/to/newglibc (so you wouldn't have to set LD_LIBRARY_PATH before running it), and the -dynamic-linker option will "bake" path to correct ld-linux.so.2 into the application.

If you can't relink the myapp application (e.g. because it is a third-party binary), not all is lost, but it gets trickier. One solution is to set a proper chroot environment for it. Another possibility is to use rtldi and a binary editor. Update: or you can use patchelf.

modprobe: ERROR: could not insert 'tun': Unknown symbol in module, or unknown parameter (see dmesg)

The "No such device" message means that no device driver with the major and minor numbers of the device node (10 and 100 in your case) exists. The reason for that is most likely that the "tun" driver failed to load, and the reason for that appears to be that the __sk_attach_filter and __sk_detach_filter symbols do not exist in the kernel you're running.

Since you say this happened after a reboot, it is likely that the kernel image was upgraded some time before that reboot, and this is the first time the system boots with the new kernel. Missing symbol errors tend to be due to the module versions not matching the kernel version.

Did you build the kernel yourself, or did you install it from som package manager? If you installed it by yourself, try again and make sure to run "make modules_install" (see e.g. https://unix.stackexchange.com/questions/20864/what-happens-in-each-step-of-the-linux-kernel-building-process for information about the kernel build targets). If you installed via a package manager, check if there some kernel modules package or tun driver package that needs to be upgraded.



Related Topics



Leave a reply



Submit