为什么升级到12.04失败并显示“glibc not found”或“libc6”或“required kernel 2.6.24”错误?

我将服务器安装表单11.04升级到11.10,然后通过ssh升级到12.04。 一切似乎都差不多 – 但glibc存在一个小问题,这使我的问题陷入困境。

我试过sudo apt-get install -f但它没有得到它需要的东西。 我在OpenVZ虚拟机中运行。

如何修复apt依赖项?

 sysadmin@svr:~$ sudo apt-get update Ign http://archive.canonical.com precise InRelease Ign http://archive.ubuntu.com precise InRelease Ign http://archive.ubuntu.com precise-updates InRelease Ign http://archive.ubuntu.com precise-security InRelease Get:1 http://archive.ubuntu.com precise Release.gpg [198 B] Hit http://archive.canonical.com precise Release.gpg Get:2 http://archive.ubuntu.com precise-updates Release.gpg [198 B] Hit http://archive.canonical.com precise Release Get:3 http://archive.ubuntu.com precise-security Release.gpg [198 B] Hit http://archive.canonical.com precise/partner i386 Packages Get:4 http://archive.ubuntu.com precise Release [49.6 kB] Ign http://archive.canonical.com precise/partner TranslationIndex Get:5 http://archive.ubuntu.com precise-updates Release [49.6 kB] Get:6 http://archive.ubuntu.com precise-security Release [49.6 kB] Get:7 http://archive.ubuntu.com precise/main i386 Packages [1274 kB] Ign http://archive.canonical.com precise/partner Translation-en Get:8 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B] Get:9 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB] Hit http://archive.ubuntu.com precise/main TranslationIndex Hit http://archive.ubuntu.com precise/restricted TranslationIndex Hit http://archive.ubuntu.com precise/universe TranslationIndex Get:10 http://archive.ubuntu.com precise-updates/main i386 Packages [20.2 kB] Get:11 http://archive.ubuntu.com precise-updates/restricted i386 Packages [770 B] Get:12 http://archive.ubuntu.com precise-updates/universe i386 Packages [2258 B] Get:13 http://archive.ubuntu.com precise-updates/main TranslationIndex [72 B] Get:14 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [71 B] Get:15 http://archive.ubuntu.com precise-updates/universe TranslationIndex [72 B] Get:16 http://archive.ubuntu.com precise-security/main i386 Packages [11.8 kB] Get:17 http://archive.ubuntu.com precise-security/restricted i386 Packages [14 B] Get:18 http://archive.ubuntu.com precise-security/universe i386 Packages [1357 B] Get:19 http://archive.ubuntu.com precise-security/main TranslationIndex [72 B] Get:20 http://archive.ubuntu.com precise-security/restricted TranslationIndex [70 B] Get:21 http://archive.ubuntu.com precise-security/universe TranslationIndex [71 B] Hit http://archive.ubuntu.com precise/main Translation-en Hit http://archive.ubuntu.com precise/restricted Translation-en Hit http://archive.ubuntu.com precise/universe Translation-en Get:22 http://archive.ubuntu.com precise-updates/main Translation-en [9145 B] Hit http://archive.ubuntu.com precise-updates/restricted Translation-en Get:23 http://archive.ubuntu.com precise-updates/universe Translation-en [1344 B] Get:24 http://archive.ubuntu.com precise-security/main Translation-en [3549 B] Hit http://archive.ubuntu.com precise-security/restricted Translation-en Get:25 http://archive.ubuntu.com precise-security/universe Translation-en [760 B] Fetched 6279 kB in 57s (109 kB/s) Reading package lists... Done sysadmin@svr:~$ sudo apt-get ugrade E: Invalid operation ugrade sysadmin@svr:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: libc6 : Depends: libc-bin (= 2.13-20ubuntu5.1) but 2.15-0ubuntu10 is installed libncurses5 : Depends: libtinfo5 (= 5.9-1ubuntu5) but 5.9-4 is installed libnih-dbus1 : Depends: libnih1 (= 1.0.3-4ubuntu9) but 1.0.3-4ubuntu2 is installed E: Unmet dependencies. Try using -f. sysadmin@svr:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: libswscale0 libavutil50 python-support g++-4.5 libboost-program-options1.42.0 librpmio1 libpostproc51 libavformat52 libstdc++6-4.5-dev libavfilter1 libavcodec52 libboost-filesystem1.42.0 libboost-system1.42.0 libavdevice52 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libc-dev-bin libc6 libc6-dev libncurses5 libnih1 Suggested packages: glibc-doc The following packages will be upgraded: libc-dev-bin libc6 libc6-dev libncurses5 libnih1 5 upgraded, 0 newly installed, 0 to remove and 335 not upgraded. 2 not fully installed or removed. Need to get 0 B/9099 kB of archives. After this operation, 1618 kB disk space will be freed. Do you want to continue [Y/n]? locale: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by locale) Preconfiguring packages ... Setting up libc-bin (2.15-0ubuntu10) ... (Reading database ... 31190 files and directories currently installed.) Preparing to replace libc6-dev 2.13-20ubuntu5.1 (using .../libc6-dev_2.15-0ubuntu10_i386.deb) ... Unpacking replacement libc6-dev ... Preparing to replace libc-dev-bin 2.13-20ubuntu5.1 (using .../libc-dev-bin_2.15-0ubuntu10_i386.deb) ... Unpacking replacement libc-dev-bin ... Preparing to replace libc6 2.13-20ubuntu5.1 (using .../libc6_2.15-0ubuntu10_i386.deb) ... locale: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by locale) Checking for services that may need to be restarted... Checking init scripts... runlevel:/var/run/utmp: No such file or directory Checking for services that may need to be restarted... Checking init scripts... runlevel:/var/run/utmp: No such file or directory WARNING: init script for samba not found. Stopping some services possibly affected by the upgrade (will be restarted later): cron: stopping...done. WARNING: this version of the GNU libc requires kernel version 2.6.24 or later. Please upgrade your kernel before installing glibc. The installation of a 2.6 kernel _could_ ask you to install a new libc first, this is NOT a bug, and should *NOT* be reported. In that case, please add lenny sources to your /etc/apt/sources.list and run: apt-get install -t lenny linux-image-2.6 Then reboot into this new kernel, and proceed with your upgrade dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu10_i386.deb (--unpack): subprocess new pre-installation script returned error exit status 1 No apport report written because MaxReports is reached already Processing triggers for man-db ... locale: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by locale) Errors were encountered while processing: /var/cache/apt/archives/libc6_2.15-0ubuntu10_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) sysadmin@svr:~$ 

首先解释,然后解决方案:)

发生这种情况是因为您的主机几乎肯定在2.6.18内核上运行OpenVZ(所有OpenVZ容器共享主机内核)。 原因可能从稳定到普通的懒惰。 问题是Precise中包含的libc 2.15需要至少2.6.24内核才能运行。 有时这会导致发布升级失败,但是有可能完成并进入部分升级,而不是像你这样的情况。

不过不担心,libc要求是编译时选项,可以设置得更低(在这种情况下,库包含旧内核的变通方法)。 我想将最小值设置为.24是将人们拖入2012年的一种方式:)

我已经设置了一个包含重新编译的libc的PPA,它可以在2.6.18或更高版本上运行(请检查uname -r !),它应该覆盖Precise提供的当前libc。 只需添加ppa:izx / ovz-libc ,更新,它应该让你通过它。 具体来说,这样的事情:

 apt-add-repository ppa:izx/ovz-libc apt-get update apt-get -f install do-release-upgrade 

并继续,直到升级成功完成。 我强烈建议不要更换任何已更改或不存在的配置文件。

当libc在上游更新时,我将保持ppa更新。 如果你想在发生这种情况时避免出现类似的错误,你可能希望将libc-bin到我的PPA并具有高优先级,因此在PPA提供“固定”版本之前它不会更新。

希望这会有所帮助,如果有人有任何问题或其他反馈,请在此发布。

试试这个命令。 您可以使用Alt + Ctrl + T打开终端:

 sudo apt-get -o APT::Immediate-Configure=0 -f install 

你可以做一个sudo apt-get upgrade

我有同样的问题….使用Ubuntu服务器…奇怪不是吗?
希望它对你有用。

对于所有陷入do-dist升级并且无法运行的人

 apt-add-repository ppa:izx/ovz-libc 

只需手动/etc/apt/sources.list下行添加到/etc/apt/sources.list

 deb http://ppa.launchpad.net/izx/ovz-libc/ubuntu lucid main 

我不知道是否存在另一种方式,但我在桌面上有重要文件,当Ubuntu以某种方式崩溃时,我没有备份,我只是碰巧手头有Ubuntu 11.10 Boot Multi-Option安装光盘等我用CD重新启动,然后选择“从12.04 LTS升级到11.10”,经过多长时间重新安装11.10后,我终于重新启动并重新运行我的重要文件。