Can't install Vagrant box Laravel Homestead

谁说我不能喝 提交于 2019-12-29 18:33:44

问题


I'm trying to install Laravel Homestead on Mac OS X following the official documentation instructions on here.

I installed VirtualBox and Vagrant. Now I'm trying to add the Homestead box with the command vagrant box add laravel/homestead. After a while the download stops and I get an error. It doesn't let me restore the download so I have to delete the partial download file and start from zero. I've tried it many times.

I think my Internet connection has something to do since it's kinda slow and it's a large file.

Here's the complete code:

$ vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://atlas.hashicorp.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) virtualbox
2) vmware_desktop

Enter your choice: 1
==> box: Adding box 'laravel/homestead' (v0.2.7) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.7/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

transfer closed with 935392411 bytes remaining to read

After retrying:

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

HTTP server doesn't seem to support byte ranges. Cannot resume.

Any help is appreciated.


回答1:


A. Go to .vagrant.d\tmp\ and delete the partial download file, then try again.

B. If that fails, you could attempt downloading the file manually using a browser or other tool. Once downloaded, you can import it using vagrant box add laravel/homestead path/to/virtualbox.box.

(Edited: Adds second answer from comments below.)




回答2:


Try this:
rm ~/.vagrant.d/tmp/*or rm -R ~/.vagrant.d/tmp/*

Then vagrant up again.




回答3:


just goto C:\Users\YourUSERNAME\ .vagrant.d\tmp

and delete all the files then again type following command

vagrant box add laravel/homestead

Thats it Enjoy......




回答4:


Try:

vagrant box add laravel/homestead -c



回答5:


If you're using Vagrant V2 then you can use the --clean flag when adding a box.

vagrant box add laravel/homestead --clean

--clean - If given, Vagrant will remove any old temporary files from prior downloads of the same URL. This is useful if you don't want Vagrant to resume a download from a previous point, perhaps because the contents changed.

Vagrant Documentation




回答6:


I also got the same problem and I just went to

Home --> .vagrant.d -->tmp

Now here one zip file will be there, please delete that one and your done.




回答7:


type

cd ~

then type

rm -rf .vagrant.d

That should get it done .




回答8:


I solve this editing the .json file in: ~/.vagrant.d/data/machine-index Delete the value of key machines like "machines": {...} to "machines":{}




回答9:


To download a file you have to add version and provider in the URL. For example for downloading precise64 First you need its URL which is https://atlas.hashicorp.com/ubuntu/boxes/trusty64

then you have to add version and provider afterwards, for our example the download URL would be.

https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box

Then you have to add it locally from your vagrant file.

To add it locally to vagrant file use the following command

vagrant box add foo-box /path/to/vagrant-box.box
vagrant init foo-box
vagrant up

This will create the vagrantfile and you can configure the vagrant file.




回答10:


I was simply resuming the process a few times before it was finally done. I think that the main problem is with the internet connection, it falters here at my home. The cleanest way certainly would be what others already suggested plus moving somewhere with a stable connection.




回答11:


This is a repository problem and sometimes depends on the vagrant version. Updating vagrant could work but if problems persist you have to try to use the archived vagrant versions.



来源:https://stackoverflow.com/questions/31095225/cant-install-vagrant-box-laravel-homestead

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!