如何手动升级libc6?

如何手动升级libc6?

我有一个实时的 Linux 发行版,取自文章。我的工作 Linux 是 Ubuntu 14 x64,我在其中构建了实时发行版。我需要向发行版添加一个应用程序,因此我将可执行文件复制到bin文件夹、chrooted 发行版根文件夹,并在运行新应用程序后收到以下消息:

bash-4.2# pv
pv: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by pv)
pv: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by pv)

我刚刚libc.so.6从我的 Ubuntu(有 2.19)复制到发行版根目录中的 /lib64 文件夹。但后来我得到了一个错误

bash-4.2# pv
Inconsistency detected by ld.so: dl-close.c: 743: _dl_close: Assertion `map->l_init_called' failed!

所以我的猜测是我必须复制更多文件,并且我正在寻找要复制的文件的一些列表。这是我在 lib 目录中的内容。

drwxr-xr-x  9 1000 1000     4096 Aug 26 16:06 .
drwxr-xr-x 19 1000 1000     4096 Jan 26  2013 ..
drwxr-xr-x  3 1000 1000     4096 Dec  8  2011 dhcpcd
drwxr-xr-x 22 1000 1000     4096 Feb 11  2013 firmware
drwxr-xr-x  3 1000 1000     4096 Jan  9  2006 grub
-rwxr-xr-x  1 1000 1000   132520 Jan 19  2013 ld-2.13.so
-rwxr-xr-x  1 1000 1000   132520 Jan 19  2013 ld-linux-x86-64.so.2
-rwxr-xr-x  1 1000 1000   117748 Jan 19  2013 ld-linux.so.2
-rwxr-xr-x  1 1000 1000  1285552 Jan 19  2013 libX11.so.6
-rwxr-xr-x  1 1000 1000    14312 Jan 19  2013 libXau.so.6
lrwxrwxrwx  1 1000 1000       17 Aug 24 14:08 libXdmcp.so.6 -> libXdmcp.so.6.0.0
-rwxr-xr-x  1 1000 1000    22472 Dec  8  2011 libXdmcp.so.6.0.0
-rwxr-xr-x  1 1000 1000    73544 Jan 19  2013 libXext.so.6
-rwxr-xr-x  1 1000 1000    22696 Jan 19  2013 libXv.so.1
-rwxr-xr-x  1 1000 1000    35208 Jan 19  2013 libacl.so.1
-rwxr-xr-x  1 1000 1000    18568 Jan 19  2013 libattr.so.1
-rwxr-xr-x  1 1000 1000   983760 Jan 19  2013 libbfd-2.21.1.so
-rwxr-xr-x  1 1000 1000   143088 Jan 19  2013 libblkid.so.1
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libbz2.so.1 -> libbz2.so.1.0.6
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libbz2.so.1.0 -> libbz2.so.1.0.6
-rwxr-xr-x  1 1000 1000    66736 Dec  8  2011 libbz2.so.1.0.6
-rwxr-xr-x  1 1000 1000  1563856 Jan 19  2013 libc-2.13.so
-rwxr-xr-x  1 1000 1000  1563856 Jan 19  2013 libc.so.6
lrwxrwxrwx  1 1000 1000       17 Aug 24 14:08 libcom_err.so.2 -> libcom_err.so.2.1
-rwxr-xr-x  1 1000 1000    14464 Nov 19  2011 libcom_err.so.2.1
lrwxrwxrwx  1 1000 1000       17 Aug 24 14:08 libcrack.so.2 -> libcrack.so.2.8.1
-rwxr-xr-x  1 1000 1000    39200 Dec  8  2011 libcrack.so.2.8.1
-rwxr-xr-x  1 1000 1000    34912 Jan 19  2013 libcrypt.so.1
-rwxr-xr-x  1 1000 1000  1587384 Jan 19  2013 libcrypto.so.0.9.8
-r-xr-xr-x  1 1000 1000  1699360 Jan 19  2013 libcrypto.so.1.0.0
-rwxr-xr-x  1 1000 1000  1515608 Dec  8  2011 libdb-4.8.so
lrwxrwxrwx  1 1000 1000       12 Aug 24 14:08 libdb.so -> libdb-4.8.so
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libdbi.so -> libdbi.so.0.0.5
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libdbi.so.0 -> libdbi.so.0.0.5
-rwxr-xr-x  1 1000 1000    60088 Oct 11  2009 libdbi.so.0.0.5
-rwxr-xr-x  1 1000 1000    14512 Jan 19  2013 libdl-2.13.so
-rwxr-xr-x  1 1000 1000    14512 Jan 19  2013 libdl.so.2
lrwxrwxrwx  1 1000 1000       13 Aug 24 14:08 libe2p.so.2 -> libe2p.so.2.3
-rwxr-xr-x  1 1000 1000    27920 Nov 19  2011 libe2p.so.2.3
-rwxr-xr-x  1 1000 1000    22656 Jan 23  2013 libeinfo.so.1
lrwxrwxrwx  1 1000 1000       21 Aug 24 14:08 libevent-2.0.so.5 -> libevent-2.0.so.5.1.3
-rwxr-xr-x  1 1000 1000   275488 Jan 19  2013 libevent-2.0.so.5.1.3
-rwxr-xr-x  1 1000 1000    18632 Jan 19  2013 libevtlog.so.0
-rwxr-xr-x  1 1000 1000   165864 Jan 19  2013 libexpat.so.1
lrwxrwxrwx  1 1000 1000       16 Aug 24 14:08 libext2fs.so.2 -> libext2fs.so.2.4
-rwxr-xr-x  1 1000 1000   197528 Nov 19  2011 libext2fs.so.2.4
-rw-r--r--  1 1000 1000    88256 Jan 19  2013 libgcc_s.so.1
-rwxr-xr-x  1 1000 1000  1155920 Jan 19  2013 libglib-2.0.so.0
-rwxr-xr-x  1 1000 1000    14400 Jan 19  2013 libgmodule-2.0.so.0
-rwxr-xr-x  1 1000 1000     5920 Jan 19  2013 libgthread-2.0.so.0
-rwxr-xr-x  1 1000 1000 18276992 Jan 19  2013 libicudata.so.48
-rwxr-xr-x  1 1000 1000  1430144 Jan 19  2013 libicuuc.so.48
-rwxr-xr-x  1 1000 1000      527 Feb  9  2013 libip4tc.so
-rwxr-xr-x  1 1000 1000    26624 Feb  9  2013 libip4tc.so.0
-rwxr-xr-x  1 1000 1000      527 Feb  9  2013 libip6tc.so
-rwxr-xr-x  1 1000 1000    30752 Feb  9  2013 libip6tc.so.0
-rwxr-xr-x  1 1000 1000      525 Feb  9  2013 libipq.so
-rwxr-xr-x  1 1000 1000      526 Feb  9  2013 libiptc.so
-rwxr-xr-x  1 1000 1000    56112 Jan 19  2013 liblber-2.4.so.2
-rwxr-xr-x  1 1000 1000   260416 Jan 19  2013 libldap-2.4.so.2
-rwxr-xr-x  1 1000 1000   526456 Jan 19  2013 libm.so.6
-rwxr-xr-x  1 1000 1000   113672 Jan 19  2013 libmagic.so.1
-rwxr-xr-x  1 1000 1000   333648 Jan 19  2013 libncurses.so.5
-rwxr-xr-x  1 1000 1000   333648 Jan 19  2013 libncurses.so.5.9
-rwxr-xr-x  1 1000 1000   383152 Jan 19  2013 libncursesw.so.5
lrwxrwxrwx  1 1000 1000       20 Aug 24 14:08 libnfsidmap.so -> libnfsidmap.so.0.3.0
lrwxrwxrwx  1 1000 1000       20 Aug 24 14:08 libnfsidmap.so.0 -> libnfsidmap.so.0.3.0
-rwxr-xr-x  1 1000 1000    26720 Jan 19  2013 libnfsidmap.so.0.3.0
-rwxr-xr-x  1 1000 1000    88872 Dec 11  2011 libnsl-2.13.so
lrwxrwxrwx  1 1000 1000       14 Aug 24 14:08 libnsl.so.1 -> libnsl-2.13.so
lrwxrwxrwx  1 1000 1000       13 Aug 24 14:08 libnss3.so -> libnss3.so.12
-rwxr-xr-x  1 1000 1000  1246896 Nov 19  2011 libnss3.so.12
lrwxrwxrwx  1 1000 1000       18 Aug 24 14:08 libnss_compat.so -> libnss_compat.so.2
-rwxr-xr-x  1 1000 1000    31432 Jan 19  2013 libnss_compat.so.2
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libnss_dns.so -> libnss_dns.so.2
-rwxr-xr-x  1 1000 1000    22736 Feb 22  2013 libnss_dns.so.2
-rwxr-xr-x  1 1000 1000    47440 Jan 19  2013 libnss_files-2.13.so
lrwxrwxrwx  1 1000 1000       17 Aug 24 14:08 libnss_files.so -> libnss_files.so.2
-rwxr-xr-x  1 1000 1000    47440 Jan 19  2013 libnss_files.so.2
lrwxrwxrwx  1 1000 1000       18 Aug 24 14:08 libnss_hesiod.so -> libnss_hesiod.so.2
-rwxr-xr-x  1 1000 1000    18672 Jan 19  2013 libnss_hesiod.so.2
-rwxr-xr-x  1 1000 1000    35664 Jan  9  2009 libnss_mdns-0.2.so
lrwxrwxrwx  1 1000 1000       18 Aug 24 14:08 libnss_mdns.so.2 -> libnss_mdns-0.2.so
lrwxrwxrwx  1 1000 1000       15 Aug 24 14:08 libnss_nis.so -> libnss_nis.so.2
-rwxr-xr-x  1 1000 1000    43368 Jan 19  2013 libnss_nis.so.2
lrwxrwxrwx  1 1000 1000       19 Aug 24 14:08 libnss_nisplus.so -> libnss_nisplus.so.2
-rwxr-xr-x  1 1000 1000    51504 Jan 19  2013 libnss_nisplus.so.2
lrwxrwxrwx  1 1000 1000       16 Aug 24 14:08 libnssckbi.so -> libnssckbi.so.12
-rwxr-xr-x  1 1000 1000   562488 Nov 19  2011 libnssckbi.so.12
lrwxrwxrwx  1 1000 1000       16 Aug 24 14:08 libnssdbm3.so -> libnssdbm3.so.12
-rwxr-xr-x  1 1000 1000   158544 Nov 19  2011 libnssdbm3.so.12
lrwxrwxrwx  1 1000 1000       19 Aug 24 14:08 libnsssysinit.so -> libnsssysinit.so.12
-rwxr-xr-x  1 1000 1000    10136 Nov 19  2011 libnsssysinit.so.12
lrwxrwxrwx  1 1000 1000       17 Aug 24 14:08 libnssutil3.so -> libnssutil3.so.12
-rwxr-xr-x  1 1000 1000   125704 Nov 19  2011 libnssutil3.so.12
-rwxr-xr-x  1 1000 1000    51608 Jan 19  2013 libpam.so
-rwxr-xr-x  1 1000 1000    51608 Jan 19  2013 libpam.so.0
-rwxr-xr-x  1 1000 1000    14392 Jan 19  2013 libpam_misc.so
-rwxr-xr-x  1 1000 1000    14392 Jan 19  2013 libpam_misc.so.0
-rwxr-xr-x  1 1000 1000    14392 Jan 19  2013 libpamc.so
-rwxr-xr-x  1 1000 1000   277456 Jan 19  2013 libparted.so.1
-rwxr-xr-x  1 1000 1000   229256 Jan 19  2013 libpcap.so.1
-rwxr-xr-x  1 1000 1000    48192 Jan 19  2013 libpci.so.3
-rwxr-xr-x  1 1000 1000   239672 Jan 19  2013 libpcre.so.0
-rwxr-xr-x  1 1000 1000    48080 Jan 19  2013 libpopt.so.0
-r-xr-xr-x  1 1000 1000    64224 Jan 19  2013 libproc-3.2.8.so
-rwxr-xr-x  1 1000 1000   131256 Jan 19  2013 libpthread.so.0
lrwxrwxrwx  1 1000 1000       10 Aug 24 14:08 librc.so -> librc.so.1
-rwxr-xr-x  1 1000 1000    47456 Dec 26  2011 librc.so.1
-r-xr-xr-x  1 1000 1000   275672 Jan 19  2013 libreadline.so.6
-r-xr-xr-x  1 1000 1000   275672 Jan 19  2013 libreadline.so.6.2
-rwxr-xr-x  1 1000 1000    80528 Jan 19  2013 libresolv.so.2
-rwxr-xr-x  1 1000 1000    35656 Jan 19  2013 librt.so.1
-rwxr-xr-x  1 1000 1000    27000 Jan 19  2013 libss.so.2
-rwxr-xr-x  1 1000 1000   338832 Jan 19  2013 libssl.so.0.9.8
-r-xr-xr-x  1 1000 1000   373216 Jan 19  2013 libssl.so.1.0.0
-rwxr-xr-x  1 1000 1000   970448 Jan 19  2013 libstdc++.so.6
-rwxr-xr-x  1 1000 1000   433744 Jan 19  2013 libsyslog-ng.so.0
-rwxr-xr-x  1 1000 1000   143184 Jan 19  2013 libtirpc.so.1
-rwxr-xr-x  1 1000 1000    51600 Jan 19  2013 libusb-1.0.so.0
-rwxr-xr-x  1 1000 1000    10464 Jan 19  2013 libutil.so.1
-rwxr-xr-x  1 1000 1000      526 Jan 19  2013 libuuid.so
lrwxrwxrwx  1 1000 1000       16 Aug 24 14:08 libuuid.so.1 -> libuuid.so.1.3.0
-rwxr-xr-x  1 1000 1000    18776 Nov 19  2011 libuuid.so.1.3.0
-rwxr-xr-x  1 1000 1000    33904 Jan 19  2013 libwrap.so.0
-rwxr-xr-x  1 1000 1000   117344 Jan 19  2013 libxcb.so.1
-rwxr-xr-x  1 1000 1000  1335680 Jan 19  2013 libxml2.so.2
-rwxr-xr-x  1 1000 1000      529 Feb  9  2013 libxtables.so
-rwxr-xr-x  1 1000 1000    47688 Feb  9  2013 libxtables.so.7
-rwxr-xr-x  1 1000 1000    92504 Jan 19  2013 libz.so.1
drwxr-xr-x  3 1000 1000     4096 Feb 11  2013 modules
drwxr-xr-x  4 1000 1000     4096 Jan 23  2013 rc
drwxr-xr-x  3 1000 1000     4096 Dec 26  2011 security
drwxr-xr-x  6 1000 1000     4096 Feb 11  2013 udev

UPD1:或者我下载了 GLIBC 2.19 源代码,编译并将库复制到发行版的 lib 目录中。现在我在 chroot 时遇到了另一个错误:

sudo chroot root_tree64/
/bin/bash: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

相关内容