1

In Ubuntu, I can use the following wget flag to get a debian, i.e.,

wget --content-disposition https://packagecloud.io/xxxxx/download.deb
dpkg -i ...

In Alpine, wget complains that --content-disposition isn't valid:

wget: unrecognized option: content-disposition
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
        [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy

In alpine, do I need to download a different "wget"?

3

In Alpine Linux, a lot of the common shell tools are replaced by BusyBox. You can see this is the case with wget by checking the output of the following command:

ls -lah $(which wget)

In the Alpine install in front of me, that is a symbolic link to /bin/busybox

In BusyBox, wget does not have the option --content-disposition:

# wget --help
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
    [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
    [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

    --spider    Only check URL existence: $? is 0 if exists
    -c      Continue retrieval of aborted transfer
    -q      Quiet
    -P DIR      Save to DIR (default .)
    -S          Show server response
    -T SEC      Network read timeout is SEC seconds
    -O FILE     Save to FILE ('-' for stdout)
    -U STR      Use STR for User-Agent header
    -Y on/off   Use proxy

You will also find that GNU wget is available in the official Alpine repositories, so to get the full version it is as simple as:

apk update
apk add wget

And then you have GNU wget installed, which should behave more like it does on other systems you have used:

# wget --help | grep -A1 content-disposition
       --content-disposition       honor the Content-Disposition header when
                                     choosing local file names (EXPERIMENTAL)
  • yep in the error I have above, it points to busybox, didn't know that the busybox wget wasn't "full", thanks! – Tommy Jun 17 '19 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.