I have a quite old box in a remote server farm. So I have no direct access. Only remote SSH (and via SSH to a serial console). I haven't updated this box in ages. Now, whenever I want to install a new package, a dependency to glibc appears. Unfortunately, the install of glibc depends on a 2.6 kernel and I am running a venerable 2.4 kernel (one more reason to upgrade).

The problem is, that the install of a new kernel has an indirect (over locales) dependency to glibc. So, to install glibc, I need a new kernel. For a new kernel, I need to upgrade glibc. Essentially I am blocked. What's the best way to proceed considering I have no "hardware" access?

Here's a quick transcript of the upgrade process:

[green:~]% sudo aptitude install linux-image-686
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following packages are unused and will be REMOVED:
The following NEW packages will be automatically installed:
  dash libc6-i686 libparse-recdescent-perl linux-image-2.6-686
  linux-image-2.6.18-6-686 module-init-tools yaird
The following packages have been kept back:
  adduser apache2 apache2-mpm-prefork apache2-utils apache2.2-common apt
  apt-utils aptitude autoconf autotools-dev awstats base-files base-passwd
  util-linux vacation vim vim-common wamerican wbritish wget whiptail whois
  wwwconfig-common zlib1g
The following NEW packages will be installed:
  dash libc6-i686 libparse-recdescent-perl linux-image-2.6-686
  linux-image-2.6.18-6-686 linux-image-686 module-init-tools yaird
The following packages will be upgraded:
  hotplug libc6
2 packages upgraded, 8 newly installed, 1 to remove and 277 not upgraded.
Need to get 0B/22.7MB of archives. After unpacking 52.1MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
Preconfiguring packages ...
(Reading database ... 34065 files and directories currently installed.)
Preparing to replace libc6 2.3.6.ds1-13 (using .../libc6_2.7-18lenny2_i386.deb) ...
Checking for services that may need to be restarted...
Checking init scripts...
WARNING: init script for postgresql not found.

  [ --- libc6 config screen appears here --- ]

WARNING: POSIX threads library NPTL requires kernel version
2.6.8 or later. If you use a kernel 2.4, please upgrade it
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 etch sources to your /etc/apt/sources.list and run:
  apt-get install -t etch linux-image-2.6
Then reboot into this new kernel, and proceed with your upgrade
dpkg: error processing /var/cache/apt/archives/libc6_2.7-18lenny2_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Ack!  Something bad happened while installing packages.  Trying to recover:
dpkg: dependency problems prevent configuration of locales:
locales depends on glibc-2.7-1; however:
  Package glibc-2.7-1 is not installed.
dpkg: error processing locales (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

Now, if I follow the instrunctions as promted I get the following. Note that I am using aptitude instead of apt-get to benefit from the better dependency tracking. I did try with apt-get first. But that let me to the same problem.

[green:~]% sudo aptitude install -t etch linux-image-2.6.26-2-686
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
E: Unable to correct problems, you have held broken packages.
E: Unable to correct dependencies, some packages cannot be installed
E: Unable to resolve some dependencies!
Some packages had unmet dependencies.  This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

The following packages have unmet dependencies:
  linux-image-2.6.26-2-686: Depends: initramfs-tools (>= 0.55) but it is not installable or
                yaird (>= 0.0.13) but it is not installable or
                linux-initramfs-tool which is a virtual package.

Any ideas?

  • Got anything like iLO/DRAC access that will allow you to remote mount a CD ISO? – Chopper3 Mar 27 '10 at 12:42
  • unfortunately no. cheap hosting... ;) – exhuma Mar 27 '10 at 13:17

In the subject, you say that the machine is running Debian 3.1 (Sarge). However, the glibc dependency and error messages you have posted indicate that you are trying to install packages from Debian 5.0 (Lenny). This probably means your /etc/apt/sources.list file references stable rather than sarge (i.e. you are taking packages from the latest stable release at the current time, rather than the release you have installed).

Try editing /etc/apt/sources.list, replacing all the references to stable with sarge. For example, a line like:

deb http://ftp.uk.debian.org/debian/ stable main non-free contrib

should become:

deb http://ftp.uk.debian.org/debian/ sarge main non-free contrib

Run aptitude update and you should then be able to upgrade to the latest packages from sarge.

However, Sarge was de-supported on 31 March 2008, so it would probably be best upgrading the machine to Lenny. Since Lenny is the second major version to be released since Sarge, it is likely to be easier to upgrade to the intermediate release, Etch, first. Take a look at section 4 of the release notes for Etch and Lenny for details of how to do this. It'd also be worth making sure you have a viable backup before starting, just in case something goes wrong.

| improve this answer | |
  • This sounds very likely. In any case I have begun migrating most essential services to a different box. Once I'm done with that and have tested that all is working on the new host I'll try your idea. And you are right. /etc/debian_version reads 3.1. And following your suggestions, I looked at sources.list. It's a mess. This was my first debian install. I must have tried things out at some point while not yet understanding apt... I should have the second box up and running in a few weeks. Then I'll give it a try. – exhuma Mar 27 '10 at 21:15

I have an idea, but it could lead to broken packages, so make a backup first, or try it on some other machine:

You can install a package via dpkg with the option --force-depends, which turns all dependency problems into warnings.

I've used this to install a printer driver, and it worked fine - because technically, everything was installed correctly. The only problem was, that aptitude reported broken packages afterwards. I could not figure out, how to fix them (and the printer driver wasn't important enough to invest a lot of time, so I simply uninstalled it).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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