4

I'm running sid, and in the course of trying to cross-grade my system from i386 to amd64 I came across some ancient packages that I couldn't remove. Some background: I've had this system since potato, or maybe earlier.

There are about a hundred packages like this, so I'd like a generic or scriptable answer. Here's one example:

bminton:/var/cache/apt/archives# dpkg --purge libstdc++2.10-dev
(Reading database ... 1352516 files and directories currently installed.)
Removing libstdc++2.10-dev (1:2.95.4-27) ...
install-info: No dir file specified; try --help for more information.
dpkg: error processing package libstdc++2.10-dev (--purge):
 subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
 libstdc++2.10-dev

The prerm script `/var/lib/dpkg/info/libstdc++2.10-dev.prerm script contains the following:

#! /bin/sh -e



install-info --quiet --remove iostream-2.95

Manually running install-info --quiet --remove iostream-2.95 gives the following error:

install-info: No dir file specified; try --help for more information.
Brian Minton
  • 367
  • 2
  • 15
  • 1
    How would you know if it is ancient or not? – Nidal Jul 24 '14 at 14:43
  • 1
    *Since potato*?!? There's gotta be a special club for this, lol. Are you afraid of just replacing the system? Methinks keeping it upgraded will eventually unravel into more trouble than it is worth. – goldilocks Jul 24 '14 at 14:46
  • @Networker https://packages.debian.org/search?keywords=libstdc%2B%2B2.10-dev shows nothing, and http://archive.debian.net/woody/i386/libstdc++2.10-dev shows it. It also shows up in `aptitude search ?obsolete` – Brian Minton Jul 24 '14 at 14:47
  • 1
    @Networker Also, libstdc++2.10 is ancient. Like a decade and a half. This is looking back into the big bang, debian wise. – goldilocks Jul 24 '14 at 14:49
  • @goldilocks indeed, I have another system that I just installed from scratch, but this is my home desktop and it works. I know I've had some cruft build up, and I don't think there is anything on here older than woody, but even so, trying to keep it up to date is half the fun. – Brian Minton Jul 24 '14 at 14:49
  • 1
    @goldilocks I think I have a machine that can join your Potato Club. Upgrades on Debian are supposed to work (and mostly do). Of course, you are supposed to remove the obsolete packages... – derobert Jul 24 '14 at 15:05

3 Answers3

3

dpkg used to have its own install-info script which was used in place of the GNU one. An email about the change gives a suggestion for packages (formatting added):

These packages should just drop their info files in /usr/share/info, and call the update-info-dir script if present (postinst and prerm). They could suggest/recommend the info package.

So, what I'd suggest you do is edit (yes, edit) /var/lib/dpkg/info/libstdc++2.10-dev.prerm and comment out the install-info ... line. Do the same for other packages with that failure. Once you're done purging the packages, manually run update-info-dir.

BTW: In the future, after doing a upgrade, you should check the list of obsolete/local packages on your system and purge them if not needed. Otherwise, you wind up with very outdated maintainer scripts left lying around.

derobert
  • 107,579
  • 20
  • 231
  • 279
3

I solved it by making my own install-info command and putting it before /usr/bin in $PATH. The script was

#!/bin/sh
/usr/bin/install-info "$@" || true
derobert
  • 107,579
  • 20
  • 231
  • 279
Brian Minton
  • 367
  • 2
  • 15
1

I'm new to Linux so that may be terrible advice, but the only thing that worked for me, after trying safer solutions (changing $PATH etc) was to "remove" the old install-info (rename it).

> which install-info
/usr/bin/install-info
> mv /usr/bin/install-info install-info.bak

I guess this forced him to use the new one.

The upgrade went ultra-smooth after this.

Julien
  • 111
  • 2