{"id":405,"date":"2021-06-04T08:31:09","date_gmt":"2021-06-04T08:31:09","guid":{"rendered":"https:\/\/francisfisher.me.uk\/problem\/?p=405"},"modified":"2023-01-15T11:35:26","modified_gmt":"2023-01-15T11:35:26","slug":"building-package-from-sourcecannot-open-potfiles-in-temp-for-writing","status":"publish","type":"post","link":"https:\/\/francisfisher.me.uk\/problem\/2021\/building-package-from-sourcecannot-open-potfiles-in-temp-for-writing\/","title":{"rendered":"Building package from source:Cannot open POTFILES.in.temp for writing"},"content":{"rendered":"\n<p>I recently ran to an error when building a .deb package from source (on Ubuntu). I found a few people asking for help with the error message over the year, but I didn't find anyone offering an answer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/src\/collectd-5.12.0$ debuild -us -uc -i -I\ndpkg-buildpackage -us -uc -ui -i -I\ndpkg-buildpackage: info: source package collectd\ndpkg-buildpackage: info: source version 5.12.0-6\ndpkg-buildpackage: info: source distribution unstable\ndpkg-buildpackage: info: source changed by Bernd Zeimetz bzed@debian.org\ndpkg-source -i -I --before-build .\ndpkg-buildpackage: info: host architecture amd64\nfakeroot debian\/rules clean\ndh_testdir\ndh_testroot\nrm -f build-stamp\n&#91; ! -f Makefile ] || \/usr\/bin\/make distclean\nrm -f debian\/README.Debian.plugins\nrm -f src\/.1 src\/.5\nrm -rf debian\/pkgconfig\ndh_autoreconf_clean\ndh_clean\ndebconf-updatepo\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nprint() on closed filehandle OUT at \/usr\/share\/intltool-debian\/intltool-extract line 942.\nCannot open POTFILES.in.temp for writing at \/usr\/share\/intltool-debian\/intltool-update line 615.\nmake: *** &#91;debian\/rules:271: clean] Error 1\ndpkg-buildpackage: error: fakeroot debian\/rules clean subprocess returned exit status 2\ndebuild: fatal error at line 1182:\ndpkg-buildpackage -us -uc -ui -i -I failed<\/code><\/pre>\n\n\n\n<p>In my case, the error occurred because I had downloaded the source package as root, so this caused permissions issues while building the package as a user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt source collectd\n<\/code><\/pre>\n\n\n\n<p>If your source is owned by root as mine was, the solution is to change the ownership of the files to your user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo chown &lt;YOUR USERNAME&gt;.&lt;YOUR USERNAME&gt; -R ~\/src\/collectd-5.12.0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I recently ran to an error when building a .deb package from source (on Ubuntu). I found a few people asking for help with the error message over the year, but I didn't find anyone offering an answer. In my case, the error occurred because I had downloaded the source package as root, so this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3],"tags":[6,14],"_links":{"self":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/405"}],"collection":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":2,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/405\/revisions"}],"predecessor-version":[{"id":424,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/405\/revisions\/424"}],"wp:attachment":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/media?parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/categories?post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/tags?post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}