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
Tail a Log into an Excerpt in Real Time
PHPmyadmin Mcrypt Extension Is Missing
How Does One Override an Existing Zsh Keyboard Completion
How to Rename a Kernel Module Name Without Renaming The .Ko Passed to Insmod
Bash Script with User Defined Functions in Autocomplete
How to Link a Linux's Thread Tid and a Pthread_T "Thread Id"
How Does Sort Work Out How Much Ram There Is
How to Connect to Docker Container from Localhost
Sending Realtime Signal from a Kernel Module to User Space Fails
What Is Real Time Priority of a Process
How to Extract Text Which Matches Particular Fields in Text File Using Linux Commands
Infinite Loop Receive from Serial Port
In Bash Tee Is Making Function Variables Local, How to Escape This
How to Generate Files in a Docker Container for Having The Same Owner as The Host's User
How to Use Xargs to Run a Function in a Command Substitution for Each Match
Corrupt Image File After Uploading It Using Ftp Command from Linux, with Type Ascii