ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Error when packaging a binary .deb file with bloom: file changed as we read it

asked 2019-03-09 17:46:51 -0500

sgloutnikov gravatar image

I am packaging a ROS node with bloom, following the following answer and am receiving a 'file changed as we read it' error at the final step. If I re-run the command everything works fine (as far as I can tell) and the deb package is produced in /src. Any ideas on why this is being produced?

Environment: Ubuntu Xenial, ROS Kinect, bloom 0.7.2-1, debhelper 9.20160115ubuntu3, fakeroot 1.20.2-1ubuntu1

bloom-generate rosdebian --os-name ubuntu --os-version xenial --ros-distro kinetic

fakeroot debian/rules binary

Errors out the first time:

dpkg-deb --build debian/ros-kinetic-test-node ..
dpkg-deb: building package 'ros-kinetic-test-node' in '../ros-kinetic-test-node_0.7.0-0xenial_amd64.deb'. tar: .: file changed as we read it
dpkg-deb: error: subprocess tar -cf returned error exit status 1
dh_builddeb: dpkg-deb --build debian/ros-kinetic-test-node .. returned exit code 2
debian/rules:22: recipe for target 'binary' failed
make: * [binary] Error 1

Running fakeroot debian/rules binary again right after, seems to package the .deb fine:

dh binary -v --buildsystem=cmake
dh_builddeb -O-v -O--buildsystem=cmake
dpkg-deb --build debian/ros-kinetic-test-node ..
dpkg-deb: building package 'ros-kinetic-test-node' in '../ros-kinetic-test-node_0.7.0-0xenial_amd64.deb'.

edit retag flag offensive close merge delete


It's been a while since I've encountered that tar error myself, and I haven't built a standalone ROS package. When I've seen the tar error it's usually because I'm trying to archive a directory that I'm creating the archive file in. You might try running fakeroot debian/rules -n binary to "just print" the actions taken by the debian/rules makefile. That might tell you what the tar command is so you can investigate further.

nuclearsandwich gravatar image nuclearsandwich  ( 2019-03-15 07:40:22 -0500 )edit

The output of fakeroot debian/rules -n binary is just this:

dh binary -v --buildsystem=cmake

Since I posted this I tried another environment and if I run the exact same steps on Ubuntu Bionic with ROS Melodic, I see no errors and packages from the first try.

sgloutnikov gravatar image sgloutnikov  ( 2019-03-18 13:22:40 -0500 )edit

@sgloutnikov since that sounds like the solution you went with, I'd recommend posting an answer to your own question (rather than just a comment) to help others who may encounter similar issues.

nuclearsandwich gravatar image nuclearsandwich  ( 2019-03-18 15:17:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-18 17:12:37 -0500

sgloutnikov gravatar image

Following the same instructions under a Ubuntu Bionic with ROS Melodic environment produced no errors. If you need to build a ROS package under Xenial and Kinetic, and are seeing the same error, just run the fakeroot debian/rules binary command again--the deb file produced worked fine for me.

edit flag offensive delete link more


In general it's probably a good idea to build packages on the same platform which they are targeting. It's possible to do so inside of a container, chroot, or virtual machine if your development host is different.

nuclearsandwich gravatar image nuclearsandwich  ( 2019-03-19 07:59:59 -0500 )edit

Question Tools



Asked: 2019-03-09 17:46:51 -0500

Seen: 713 times

Last updated: Mar 18 '19