Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I upgraded my server installation form 11.04 to 11.10, then to 12.04 over ssh. All seems almost ok - but there is a small issue with glibc, which is messing up my apt.

I tried sudo apt-get install -f but it does not get what it needs. I am running in a OpenVZ virtual machine.

How can I fix my apt dependencies?

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:~$ 
share|improve this question
    
    
I decided to wait a while until I update, hoping that the issue would be resolved without further effort. I have had to re-install the system a couple of times already. I suspect the top answer might hold the key to the problem, but have not tested it yet. I will tick it once verified - which I will endeavor to do soon. –  Billy Moon Jun 8 '12 at 17:16
    
Thanks Billy - please comment on the answer if you have any more questions/problems! –  izx Jun 16 '12 at 10:48
add comment

4 Answers 4

For everybody stuck in the do-dist-upgrade and not being able to run

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

Just add following line manually to /etc/apt/sources.list:

deb http://ppa.launchpad.net/izx/ovz-libc/ubuntu lucid main
share|improve this answer
    
This doesn't work for me with Virtuzzo containers. I use a template from 10.04 and fails. But from Debian 6.0 with a more updated kernel it works for Virtuozzo 4.6 –  shakaran Aug 15 '13 at 10:40
add comment

Try this command. You can open a terminal with Alt+Ctrl+T:

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

After you can do a sudo apt-get upgrade.

I've had the same problem .... using Ubuntu server ... strange isn't it ?
Hope it'll work for you.

share|improve this answer
add comment

First the explanation, then a solution :)

This happens because your host is almost certainly running OpenVZ on a 2.6.18 kernel (all OpenVZ containers share the host kernel). The reason can range from stability to just plain laziness. The problem is that the libc 2.15 included with Precise requires a minimum 2.6.24 kernel to function. Sometimes this will cause the release-upgrade to fail, but it is possible to complete and get into a partially upgraded neither-here-not-there situation like you have.

Fear not though, the libc requirement is a compile-time option, and it can be set lower (in which case the library includes workarounds for older kernels). I guess setting the minimum to .24 is one way to drag folks into 2012 :)

I've set up a PPA containing a recompiled libc which will work on 2.6.18 or newer (please check uname -r!), and it should override the current libc provided by Precise. Just add ppa:izx/ovz-libc, update, and it should let you get past this. Specifically, something like this:

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

and continue on until the upgrade completes successfully. I highly recommend NOT replacing any changed or non-existent config files.

I will be keeping the ppa updated as and when libc is updated upstream. If you want to avoid a similar error when that happens, you may want to pin libc-bin to my PPA with a high priority, so it won't update until the "fixed" version is available from the PPA.

Hope this helps, and please post here if anyone has any questions or other feedback.

share|improve this answer
    
Could you explain how you were able to make this change? I've tried poking around the libc6 source, but can't find it. I'm stuck in a semi-upgraded state on an OpenVZ VPS running 2.6.18, but the packages require libc6 2.17, not 2.15. Any help would be much appreciated. –  red_sky Jan 29 at 21:14
add comment

I don't know if there exists another way but I had important files on my desktop that I did not back up when Ubuntu crashed on me in that exact fashion, I just so happened to have on hand the Ubuntu 11.10 Boot Multi-Option install CD and so I rebooted with the CD and then picked "Upgrade from 12.04 LTS to 11.10" and after how much time it spent re-installing 11.10 I am finally up and running again with my important files intact.

share|improve this answer
add comment

protected by Community Apr 26 '13 at 14:58

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.