You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Azure池启动任务中运行多条命令?启动任务执行失败求助

Fixing wget Usage Error in Azure Batch Start Task

It looks like your wget command is hitting a quoting/parsing issue in the Azure Batch start task environment—this is a common gotcha when passing multi-argument commands with nested quotes to shell environments. The error you're seeing (Usage: wget [OPTION]... [URL]...) means the shell is splitting your command incorrectly, so wget isn't receiving the parameters it expects.

Here's the corrected command to use:

sudo bash -c 'wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.rpm && yum localinstall jdk-8u161-linux-x64.rpm -y'

Why this works:

  • Wrapping the entire command chain in bash -c '' tells the shell to treat everything inside the single quotes as a single command string. This prevents the outer shell from misinterpreting the nested double quotes in your Cookie header.
  • We removed the extra sudo before yum localinstall—since we're already running the entire command under sudo, it's redundant (and can cause unnecessary permission issues in some cases).

Additional checks:

  • Verify that the Azure Batch node has internet access to reach Oracle's download server.
  • If you still hit issues, add verbose output to wget (-v flag) to get more detailed logs about what's going wrong:
    sudo bash -c 'wget -v --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.rpm && yum localinstall jdk-8u161-linux-x64.rpm -y'
    

内容的提问来源于stack exchange,提问作者Quan Hoang

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:29:30