3

After running do-release-upgrade --proposed on my Ubuntu Server 8.04, I got the message:

The upgrade is completed but there were errors during the upgrade process.

Searching up the upgrade output, I found this:

Setting up tar (1.22-2) ...

tar: ./md5sums: Cannot utime: Bad file descriptor
tar: ./control: Cannot utime: Bad file descriptor
tar: .: Cannot utime: Bad file descriptor
tar: Exiting with failure status due to previous errors
dpkg-deb: subprocess tar returned error exit status 2
dpkg: error processing /var/cache/apt/archives/diff_1%3a2.8.1-18_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/diff_1%3a2.8.1-18_all.deb
Exception during pm.DoInstall():  E:Sub-process /usr/bin/dpkg returned an error code (1)

Could not install the upgrades

The upgrade is now aborted. Your system could be in an unusable
state. A recovery will run now (dpkg --configure -a).

Apparenly, this is a known bug. More details are here and here.

I will post the workaround I found as an answer.

3 Answers 3

3

As a workaround, you can create a wrapper for tar that will add the --touch option:

create a file named tar under /usr/local/sbin with the following content:

#!/bin/sh
exec /bin/tar --touch -"$@"

Do:

chmod +x /usr/local/sbin/tar

Now run aptitude dist-upgrade to continue the upgrade process. Delete this file after installation has completed.

2
  • 2
    this is probably chmod +x /usr/local/sbin/tar Jun 27, 2010 at 7:06
  • You saved me from being stuck with my hosting provider's old Ubuntu template. +1
    – Unknown
    Dec 8, 2010 at 4:43
3

Sometimes the /usr/local/sbin/tar trick doesn't work. But I found this option helped for me. Run

export TAR_OPTIONS='--touch'

Then continue with your

apt-get upgrade
0

I got this same error, and I couldn't install anything with aptitude either because of tar being broken. I had to leave /usr/local/sbin/tar so that aptitude would continue to work correctly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .