为什么我的升级到12.04失败,并显示“找不到glibc”或“ libc6”或“需要内核2.6.24”错误?


8

我将服务器安装形式从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:~$ 


我决定等一会儿再更新,希望该问题能得到进一步解决。我已经不得不重新安装系统几次。我怀疑最重要的答案可能是解决问题的关键,但尚未对其进行测试。验证完成后,我会在勾号上打勾-我会尽快进行。
比利·穆恩

谢谢比利-如果您还有其他疑问/问题,请对答案发表评论!
ish 2012年

Answers:


11

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

发生这种情况是因为您的主机几乎可以肯定在2.6.18内核上运行OpenVZ(所有OpenVZ容器共享该主机内核)。原因可能从稳定到只是懒惰。问题在于,Precise随附的libc 2.15至少需要2.6.24内核才能运行。有时,这将导致发行版升级失败,但是有可能像您一样完成并进入部分升级的“既不是这里又不是那里”的情况。

不用担心,libc要求是一个编译时选项,可以将其设置得较低(在这种情况下,该库包含旧内核的解决方法)。我猜将最小值设置为.24是将人们拖入2012年的一种方法:)

我已经设置了一个包含重新编译的libcPPA,它将在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提供“固定”版本后,它才会更新。

希望对您有所帮助,如果有人有任何疑问或其他反馈,请在此处发布。


您能解释一下如何进行此更改吗?我尝试在libc6源代码中戳戳,但是找不到它。我在运行2.6.18的OpenVZ VPS上处于半升级状态,但是这些软件包需要libc6 2.17,而不是2.15。任何帮助将非常感激。
red_sky 2014年

3

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

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

之后你可以做一个sudo apt-get upgrade

我遇到了同样的问题....使用Ubuntu服务器...奇怪吗?
希望对您有用。


1

对于每个陷入do-dist-upgrade并且​​无法运行的人

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

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

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

对于Virtuzzo容器,这对我不起作用。我使用了来自10.04的模板,但失败了。但是从Debian 6.0起,内核有了更新,它适用于Virtuozzo 4.6
shakaran

0

我不知道是否存在另一种方法,但是我的桌面上有重要文件,当Ubuntu以这种方式崩溃时,我没有备份这些文件,而我恰巧手头安装了Ubuntu 11.10 Boot Multi-Option。 CD,因此我用CD重新启动,然后选择“从12.04 LTS升级到11.10”,在花了多少时间重新安装11.10之后,我终于重新启动并运行了我的重要文件。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.