You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何通过Bash脚本下载运行Firefox?Ubuntu16下载命令失败求助

Fixing Firefox Download & Installation via Bash on Ubuntu 16.04 (No apt-get)

Hey there! Let's work through why your Firefox download isn't working and get it sorted out without using apt-get:

1. Fix the curl URL (The Top Issue)

Your original curl command uses & instead of plain & — that's an HTML escape sequence, which bash doesn't understand. On top of that, wrapping the URL in quotes prevents bash from treating & as a background process marker.

Use this corrected curl command instead:

curl -o ~/firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64"

2. Fix the Tar Extraction Command

Your current tar command has an extra path that will throw errors. The Firefox tarball extracts to a firefox directory by default, so you just need to specify where to place that directory (your home folder is perfect):

tar xjf ~/firefox.tar.bz2 -C ~/

The -C ~/ flag tells tar to drop the extracted firefox folder directly into your home directory.

3. Troubleshoot If the Download Still Fails

If curl still won't pull the file, check if you can reach Mozilla's download server at all:

curl -I "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64"

You should see a HTTP/2 302 redirect (that's normal for Mozilla's downloads). If you get a connection error, your network might be blocking access to the server.

4. Verify Curl is Installed

Ubuntu 16.04 usually includes curl by default, but if it's missing (and you don't want to use apt-get), you could grab a static curl binary as a last resort. First, confirm it's installed with:

curl --version

5. Launch Firefox Easily

Once extracted, you can start Firefox right away with:

~/firefox/firefox

To make it even simpler, create a symlink in ~/bin/ (just make sure ~/bin is in your system PATH):

ln -s ~/firefox/firefox ~/bin/firefox

Now you can launch Firefox anytime by just typing firefox in the terminal.


内容的提问来源于stack exchange,提问作者Ford O.

火山引擎 最新活动