mtmacdonald
mtmacdonald

Reputation: 15070

Why is this file failing to download?

I want to install the latest phantomjs via the terminal on Ubuntu 14.04. I ran:

curl -O https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2

But the output was like this and no file gets downloaded:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

I can download other files with curl successfully. And this file downloads if I used wget.

Why is it failing with curl? What am I doing wrong?

Upvotes: 1

Views: 1762

Answers (1)

Pafjo
Pafjo

Reputation: 5019

Bitbucket is doing a redirect. By default curl will not follow redirects so you need to use the -L flag for this.

 curl -L -O https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2

By the way, I recommend that you use -v when you want to see what happens when curl is doing a request.

Upvotes: 2

Related Questions