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.

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 "$@"

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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