Try to use packer data source, it can download libs/tools for you and keep it ready for your source block. It can be used as pre-population values from the web to be used in packer image building.