Packages fail to build with packer

May 4, 2015

I was doing a system upgrade today for my Arch home server using packer over an ssh connection. My connection dropped out and the upgrade failed. No big deal, I figured I’ll just reconnect and try again.

Well, wine-silverlight was in the middle of upgrading when the connection dropped out and when I retried the upgrade, I got this error:

error: dlls/comctl32/icon.c: already exists in working directory
ERROR: Failed to apply patch, aborting!
==> ERROR: A failure occurred in prepare().
The build failed.

There are a number of things which might cause packer to throw this error, as I learned from google. But it turns out that there is a really simple solution in my case. Packer was downloading the package files to the /tmp/packerbuild-1000/wine-silverlight directory. Something must have gotten mucked up there when the connection dropped out earlier.

A simple fix is to just remove this directory with:

$ sudo rm -R /tmp/packerbuild-1000/wine-silverlight

Then just retry your upgrade with:

$ packer -Syu

Everything should work now!