Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an issue where fails with the error message "Cannot utime":

tar: ./postinst: Cannot utime: Bad file descriptor
tar: ./preinst: Cannot utime: Bad file descriptor
tar: ./prerm: Cannot utime: Bad file descriptor
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/apache2-mpm-prefork_2.2.14-5ubuntu8.4_i386.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/apache2-mpm-prefork_2.2.14-5ubuntu8.4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

This seem to be related to as if I follow the instructions in a post on ubuntuforums.org and create a user defined /usr/local/sbin/tar the error stops happening.

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

However that solution caused me to ask a question about Extra dash insertion when trying to run tar. I would much prefer to just have regular tar working.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

The real problem is bug LP #539814. The solution is to upgrade your kernel or use a patched tar program.

Otherwise, use the next workaround: Replace the contents of the /usr/local/sbin/tar file with:

#!/bin/sh
TAR_OPTIONS="--touch $TAR_OPTIONS" /bin/tar "$@"
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.