This is probably due to a race with cloud-init. I've experienced
similar when trying to use apt with AWS, and I've been able to reduce the
issue by adding small sleeps in between my various calls.

You could also try adding a sleep before you call your update, either by
coding it inline or by adding a "pause_before" to your provisioner.
https://askubuntu.com/questions/663296/intermittent-apt-get-install-issues-when-creating-an-ami-using-packer

On Tue, Oct 15, 2019 at 8:04 AM Anil Wadghule <[email protected]> wrote:

> Packer has been so unreliable to me
>
> On multiple builds, it says "Unable to locate package libconfig-dev"
> and also other packages as well but after trying builds multiple times,
> it does find packages this is really irritating me
>
> Anyone here knows why it is so?
> Here is a packer json file
> https://gist.github.com/705c00d07ac4e88e00e35e6a79b3b1ba
>
> this work intermittently folks. it fails most of the times.. it works like
> once in a 4th try.
>
> Why does it do that? Halp!
>
> Thanks,
> Anil
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/283670dd-b486-4701-902c-5b8f3b5aeef2%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/283670dd-b486-4701-902c-5b8f3b5aeef2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAGPV1uqouTLMhjLEm5%2B2dUDUh%2B1mCDtzHet0aW5BXL3Cgzfo0A%40mail.gmail.com.

Reply via email to