Commandes Linux : vagrant box remove

VAGRANT BOX REMOVE

Commande : vagrant box remove
Usage: vagrant box remove <name>

Options:

    -f, --force                      Remove without confirmation.
        --provider PROVIDER          The specific provider type for the box to remove
        --box-version VERSION        The specific version of the box to remove
        --all                        Remove all available versions of the box
    -h, --help                       Print this help

 

Supprimer une box téléchargée en local

vagrant box remove <name>

ex :

$ vagrant box list
debian/stretch64            (virtualbox, 9.1.0)
debian/stretch64            (virtualbox, 9.5.0)
$ vagrant box remove debian/stretch64
You requested to remove the box 'debian/stretch64' with provider
'virtualbox'. This box has multiple versions. You must
explicitly specify which version you want to remove with
the `--box-version` flag or specify the `--all` flag to remove all
versions. The available versions for this box are:

 * 9.1.0
 * 9.5.0
$ vagrant box remove debian/stretch64 --box-version 9.1.0
Removing box 'debian/stretch64' (v9.1.0) with provider 'virtualbox'...
$ vagrant box list
debian/stretch64            (virtualbox, 9.5.0)

 

Supprimer toutes les versions d’une box spécifique téléchargée en local

vagrant box remove <name> --all

ex :

$ vagrant box remove debian/stretch64 --all
Removing box 'debian/stretch64' (v9.5.0) with provider 'virtualbox'...
Removing box 'debian/stretch64' (v9.1.0) with provider 'virtualbox'...

 

Supprimer toutes les boxes téléchargées en local

vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f

ex :

$ vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f
Removing box 'AlbanMontaigu/boot2docker' (v18.06.0-ce) with provider 'virtualbox'...
Removing box 'debian-9.5' (v0) with provider 'virtualbox'...
Removing box 'debian/stretch64' (v0) with provider 'virtualbox'...
Removing box 'debian/stretch64:9.5' (v0) with provider 'virtualbox'...
Removing box 'emessiha/ubuntu64-java' (v1.0.0) with provider 'virtualbox'...
Removing box 'hashicorp/precise64' (v1.1.0) with provider 'virtualbox'...
Removing box 'primalskill/ubuntu-trusty64' (v1.0.0) with provider 'virtualbox'...
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.

 

Fermer le menu