$ vagrant box update
==> default: Checking for updates to 'ubuntu/jammy64'
default: Latest installed version: 20231027.0.0
default: Version constraints: 20241002.0.0
default: Provider: virtualbox
default: Architecture: "amd64"
The metadata for the box was malformed. The exact error
is shown below. Please contact the maintainer of the box so
that this issue can be fixed.
unexpected token at '<!DOCTYPE html><html lang="en-us"><head>
<meta charset="utf-8">
<title>HashiCorp Cloud Platform</title>
...
Isso parece ser devido a uma mudança em metadata_url
.
Exemplo prático:
https://vagrantcloud.com/api/v2/vagrant/ubuntu/jammy64
Exemplo não funcional:
https://vagrantcloud.com/ubuntu/jammy64
Quando o URL mudou?
Duas soluções alternativas vêm à mente:
- uma linha (por exemplo, com
sed
) para corrigir esses URLs. - instalando uma caixa nova do mesmo tipo em outro diretório usando
vagrant init
o que fará com~/.vagrant.d/boxes/
que seja atualizado.