Portage Errors: touch: No such file or directory
- April 12th, 2011
- Posted in Gentoo
- By كارما
- Write comment
After updating coreutils you may encounter a problem using touch. This problem often manifests itself as a loop while trying to update other packages:
* Touching gcc/cstamp-h.in * touch: setting times of `gcc/cstamp-h.in': No such file or directory * make: *** [gcc/cstamp-h.in] Error 1 * Touching gcc/cstamp-h.in * touch: setting times of `gcc/cstamp-h.in': No such file or directory * make: *** [gcc/cstamp-h.in] Error 1 ...
or a one-off event that breaks the merge:
touch: setting times of `config.h.in': No such file or directory make: *** [config.h.in] Error 1 emake failed * ERROR: sys-process/psmisc-22.12 failed (compile phase): * (no error message) * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2663: Called die * The specific snippet of code: * emake || die * * If you need support, post the output of 'emerge --info =sys-process/psmisc-22.12', * the complete build log and the output of 'emerge -pqv =sys-process/psmisc-22.12'. * The complete build log is located at '/var/tmp/portage/sys-process/psmisc-22.12/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-process/psmisc-22.12/temp/environment'. * S: '/var/tmp/portage/sys-process/psmisc-22.12/work/psmisc-22.12' >>> Failed to emerge sys-process/psmisc-22.12,
This problem occurs on systems running kernels older than 2.6.22, where futimesat was introduced. This pops up a lot on my older Gentoo VMs for obvious reasons (wouldn’t it be nice if we could have an up-to-date stable xen-sources package one day?).
You have four options:
Upgrade your kernel – this is the ideal solution but in an ideal world we all live forever and make too much money.
Disable sandbox – sandbox is intended to soften poorly written scripts. simply add -sandbox to your FEATURES variable. Not a big fan of this solution.
Replace touch with busybox’s implementation – this is a neat trick but I have encountered problems using bb’s touch in place of coreutils and the next time you update the symlink may get wiped out.
# rm /bin/touch && ln -s /bin/bb /bin/touch
Mask versions of coreutils newer than 8.5 – this is the ideologically correct way to take care of things if upgrading the kernel is not in your cards today.
# echo ">=sys-apps/coreutils-8.6" >> /etc/portage/package.mask
It’s important that you remember to remove the mask once you do. Funnily enough, if you have already installed coreutils-8.6+ emerging 8.5 will fail due to the broken touch, in this case you may wish to temporarily use one of the other solutions to get it installed:
checking for struct utmpx.ut_exit.e_termination... yes checking for struct utmp.ut_exit.e_termination... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for working re_compile_pattern... yes checking whether rename honors trailing slash on destination... touch: setting times of `conftest.f': No such file or directory configure: error: cannot create temporary files !!! Please attach the following file when seeking support: !!! /var/tmp/portage/sys-apps/coreutils-8.5/work/coreutils-8.5/config.log * ERROR: sys-apps/coreutils-8.5 failed (compile phase): * econf failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2495: Called econf '--with-packager=Gentoo' '--with-packager-version=8.5 (p1)' '--with-packager-bug-reports=http://bugs.gentoo.org/' '--enable-install-program=arch' '--enable-no-install-program=groups,hostname,kill,su,uptime' '--enable-largefile' '--disable-libcap' '--enable-nls' '--enable-acl' '--disable-xattr' '--without-gmp' * ebuild.sh, line 557: Called die * The specific snippet of code: * die "econf failed" * * If you need support, post the output of 'emerge --info =sys-apps/coreutils-8.5', * the complete build log and the output of 'emerge -pqv =sys-apps/coreutils-8.5'. * The complete build log is located at '/var/tmp/portage/sys-apps/coreutils-8.5/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/coreutils-8.5/temp/environment'. * S: '/var/tmp/portage/sys-apps/coreutils-8.5/work/coreutils-8.5' >>> Failed to emerge sys-apps/coreutils-8.5









I really thank you for your post!
I’m trying to update old gentoo, changing CHOST at the same time and I founded this problem. You saved my life ;)
I used Gentoo server in Amazon Cloud and can not change kernel. Your offer to downgrade coreutils and mask it really works. thx for your investigation.
Note that this problem has been resolved in sandbox-2.5 (although this is currently masked). See http://bugs.gentoo.org/show_bug.cgi?id=348640
Thanks for the post ;)
Anyway I tried to downgrade from coreutils-8.7 to coreutils-8.5, but I got error! So I got a touch file from another system with coreutils-6.9 and it worked at least too update the another packages! So thats could be the 5 solution! hehe