Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
2  
this is probably chmod +x /usr/local/sbin/tar –  Aleksandar Ivanisevic Jun 27 '10 at 7:06
    
@Aleksandar Right, thanks. –  itsadok Jun 28 '10 at 5:23
    
You saved me from being stuck with my hosting provider's old Ubuntu template. +1 –  Unknown Dec 8 '10 at 4:43
add comment

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
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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