首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >wget内容配置ubuntu对高寒

wget内容配置ubuntu对高寒
EN

Unix & Linux用户
提问于 2019-06-17 17:16:19
回答 1查看 2.1K关注 0票数 1

在Ubuntu中,我可以使用以下wget标志来获得debian,即,

代码语言:javascript
复制
wget --content-disposition https://packagecloud.io/xxxxx/download.deb
dpkg -i ...

在阿尔卑斯山,wget抱怨--content-disposition无效:

代码语言:javascript
复制
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

在高山地区,我需要下载不同的"wget“吗?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2019-06-17 17:37:33

在Alpine中,许多常见的shell工具都被BusyBox所取代。通过检查以下命令的输出,可以看到wget的情况是这样的:

代码语言:javascript
复制
ls -lah $(which wget)

在我面前的阿尔卑斯安装中,这是一个指向/bin/busybox的象征性链接。

在BusyBox中,wget没有选项--content-disposition

代码语言:javascript
复制
# 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

您还会发现GNU在正式的高山存储库中是可用的,因此要获得完整版本,只需如下所示:

代码语言:javascript
复制
apk update
apk add wget

然后安装了GNU wget,它的行为应该更像您使用过的其他系统:

代码语言:javascript
复制
# wget --help | grep -A1 content-disposition
       --content-disposition       honor the Content-Disposition header when
                                     choosing local file names (EXPERIMENTAL)
票数 3
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/525468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档