AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1170986
Accepted
davejagoda
davejagoda
Asked: 2025-01-19 06:22:37 +0800 CST2025-01-19 06:22:37 +0800 CST 2025-01-19 06:22:37 +0800 CST

`vagrant box update` 失败,出现 `metadata for the box was malformed` 错误

  • 772
$ 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>
    ...

这似乎是由于 的变化造成的metadata_url。

工作示例:

https://vagrantcloud.com/api/v2/vagrant/ubuntu/jammy64

非工作示例:

https://vagrantcloud.com/ubuntu/jammy64

URL 何时更改的?

我想到两种解决方法:

  1. 一行代码(例如使用sed)即可修复这些 URL。
  2. 在另一个目录中安装相同盒子类型的全新盒子vagrant init将导致~/.vagrant.d/boxes/更新。
vagrant
  • 1 1 个回答
  • 330 Views

1 个回答

  • Voted
  1. Best Answer
    davejagoda
    2025-02-01T23:12:21+08:002025-02-01T23:12:21+08:00

    这并没有回答问题的“何时”部分。但是:

    以下是更新metadata_urlUbuntu 系统的一个方法:

    perl -pi -e 's%https://vagrantcloud.com/ubuntu/%https://vagrantcloud.com/api/v2/vagrant/ubuntu/%' metadata_url
    

    metadata_url以下是更新centos 盒子的方法:

    perl -pi -e 's%https://vagrantcloud.com/centos/%https://vagrantcloud.com/api/v2/vagrant/centos/%' metadata_url
    
    • 0

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve