Why do I have libc.so.6 under /usr/lib/x86_64-linux-gnu directory?
After I read this question difference between libc6-dev and libc6 , I started a fresh
Ubuntu 20.04 LTS VPS and went checking what files are included in some Ubuntu packages.
libc6-dev (https://packages.ubuntu.com/focal/amd64/libc6-dev/filelist) and
As we can see, the
libc6-dev have those share libraries under
libc6 ‘s share libraries are under
But what makes me curious is that:
I also have
libc.so.6 -> libc-2.31.so*). And
apt install remove libc6-devdoesn’t remove
libc.so.6. Where does this
-rw-r--r-- 1 root root 298 Apr 7 09:24 libc.soinstalled by
libc6-devpackge is only
298bytes, what? Why?
ll -h | grep libc output, left(remove
libc.so.6 is part of the
libc6 package. It is only in the file list in
/lib is a symlink to
/usr/lib, so it shows up in
/usr/lib/x86_64-linux-gnu as well.
libc.so.6 is the library which programs using the C library refer to:
$ ldd /bin/true linux-vdso.so.1 (0x00007ffc797a9000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc865f4a000) /lib64/ld-linux-x86-64.so.2 (0x00007fc86614b000)
libc.so is used when building programs, and is a linker script rather than a library; you can examine its contents:
$ cat /lib/x86_64-linux-gnu/libc.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc_nonshared.a AS_NEEDED ( /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ) )