Using apt-get dist-upgrade to upgrade software on a server, I get the following error:

Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 28575 files and directories currently installed.)
Preparing to replace debianutils 2.8.4 (using .../debianutils_2.30_i386.deb) ...
Unpacking replacement debianutils ...
dpkg: error processing /var/cache/apt/archives/debianutils_2.30_i386.deb (--unpack):
 trying to overwrite `/usr/sbin/add-shell', which is also in package passwd
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I got a similar error some minutes prior with another package so I used apt-get remove to remove the package and then apt-get upgrade which seemed to get past that first little problem... Until it hit this next one. I can't use apt-get remove to remove debianutils as this is a core package and will break the system if removed.

Any pointers as to where to go from here?


The problem is that both debianutils and passwd both contain the same file (/usr/sbin/add-shell). I'm a little confused as to how you've got 2.8.4 installed, as it's not in any released version of Debian and was created in 2004. Are you trying to upgrade from a sarge box? You should be upgrading to etch, then lenny. Upgrading between more than one version is not supported.

This may end badly, but you can fix this by running:

# dpkg -i --force-overwrite /var/cache/apt/archives/debianutils_2.30_i386.deb

but you may end up with even more problems. I think you should reconsider why you're upgrading such an old version first.

| improve this answer | |
  • 1
    +1 for the need to upgrade sarge to etch before going to Lenny. Stacey, you really, really, really don't want to force-overwrite, given that you obviously don't know enough about the system internals to fix the problems that will likely result. – womble Jun 13 '09 at 8:29
  • David, thanks for the advice but I won't be able to try it out as the (way bad) solution that I used worked fine. When I was searching for solutions I say a few posts on other sites mentioning an upgrade from sarge to lenny is what causes the problem but I was already on etch. Womble, what problems are likely to result? Now that I've done what I've put in my (bad advice) answer, is there something that I need to do now to fix things up? – Stacey Richards Jun 13 '09 at 9:01
  • Dunno, overwriting files is mostly safe. It's usually the result of one file moving from one package to another. But yeah, definitely something you want to think twice about if you don't understand what you're doing. – David Pashley Jun 13 '09 at 9:02
  • You definitely were not completely on Etch, given Etch had debianutils 2.17, and you had 2.8.4. You should make sure you are completely up to date with your current release, including making sure you have no packages on hold, before you attempt to upgrade. – David Pashley Jun 13 '09 at 9:03

Try aptitude, it's the new apt-get, but with better problem resolution.

| improve this answer | |

Please read Stephen's comments to this answer regarding not being for the novice and backing up before attempting this.

Ahhh, found what I was looking for:

dpkg -r --force all passwd
apt-get -f install

As far as I can tell, this will remove the passwd package which would normally break the system and shouldn't be considered lightly.

In this particular situation, however, it was necessary because the passwd package was conflicting with another, probably due to upgrading from sarge to lenny (which shouldn't be done), rather than upgrading from sarge to etch and then to lenny. After the initial dist-upgrade was attempted, and failed, the sources.list was changed from stable to etch to attempt to dist-upgrade the system to etch, so a further editing of sources.list, changing etch to lenny, and then dist-upgrading again would fix the problem. It did not. The damage was already done.

The last resort was attempting something that normally should not be done.

I did it.

It worked.

Admittedly I did not, and still do not, know exactly what has gone on under the hood. I can only assume the old conflicting passwd package was removed (without removing dependencies?) leaving the system unstable, then the new passwd package was installed restoring the unstable system back to sanity.

I found the solution on a site that showed the error that I encountered verbatim. There was a large list of user posts thanking the author for the fix explaining that it had worked for them, and no comments were left saying that it didn't (OK, so that doesn't mean that it never did fail). As I was stuck with a broken, un-upgradable system, this was a last resort.

Thanks to the guys that pointed out that this is a "way bad" idea. In this situation, however, with this exact error, I can report that it did fix the problem.

| improve this answer | |
  • 1
    Bad. Dangerous advice. – David Pashley Jun 13 '09 at 8:00
  • 1
    Waaaaaaay bad advice. – womble Jun 13 '09 at 8:27
  • There is nothing wrong with the advice if it had more context. Like definitely not for a novice. And have anything important backed up. I've had to use 'Yes, do as I say!' more than once to save a messed up system. – Steven Jun 13 '09 at 19:30

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.