mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-07 22:11:09 +08:00
120 lines
4.4 KiB
Markdown
120 lines
4.4 KiB
Markdown
[#]: subject: "How to Fix: bash wget Command Not Found Error"
|
||
[#]: via: "https://www.debugpoint.com/wget-not-found-error/"
|
||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||
[#]: collector: "lkxed"
|
||
[#]: translator: "geekpi"
|
||
[#]: reviewer: " "
|
||
[#]: publisher: " "
|
||
[#]: url: " "
|
||
|
||
How to Fix: bash wget Command Not Found Error
|
||
======
|
||
|
||
**Here’s how you can fix the “bash: wget command not found” error in Debian, Ubuntu and other distros.**
|
||
|
||
The famous wget utility is used to download any files from a URL via a terminal. It’s one of the most popular and fastest utilities for Linux terminals.
|
||
|
||
Being a GNU utility, wget brings some fantastic features to the table. You can implement any project, such as extracting information from the web, downloading files, pausing/resuming, etc.
|
||
|
||
However, many [Linux distros][1] do not come with this utility with default installation. So, when you want to download some files using wget, you get the wget command not found error.
|
||
|
||
Fixing it is really easy.
|
||
|
||
### Fixing wget command not found
|
||
|
||
All you need to do is open a terminal prompt and run the following command to install wget.
|
||
|
||
For Ubuntu, Linux Mint, elementaryOS, Debian and related distros:
|
||
|
||
```
|
||
sudo apt install wget
|
||
```
|
||
|
||
Arch Linux:
|
||
|
||
```
|
||
pacman -S wget
|
||
```
|
||
|
||
For Fedora (although it includes by default):
|
||
|
||
```
|
||
sudo dnf install wget
|
||
```
|
||
|
||
After installation, you can use the wget program. You can also verify whether it’s installed correctly by checking its version.
|
||
|
||
```
|
||
wget --version
|
||
```
|
||
|
||
### How to use wget
|
||
|
||
Here are some examples of how you can use the wget program.
|
||
|
||
The syntax of the command is below:
|
||
|
||
```
|
||
wget [OPTION]… [URL]…
|
||
```
|
||
|
||
For example, if I want to download an Ubuntu ISO file, then I can run the following command to download with the direct URL.
|
||
|
||
```
|
||
wget https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-desktop-amd64.iso
|
||
```
|
||
|
||
![Sample example of how to use wget][2]
|
||
|
||
Similarly, you can also download using the above command or, by combining several switches as described below. You can also get this via `wget --help` command.
|
||
|
||
```
|
||
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits)
|
||
--retry-connrefused retry even if connection is refused
|
||
--retry-on-http-error=ERRORS comma-separated list of HTTP errors to retry
|
||
-O, --output-document=FILE write documents to FILE
|
||
-nc, --no-clobber skip downloads that would download toexisting files (overwriting them)
|
||
--no-netrc don't try to obtain credentials from .netrc
|
||
-c, --continue resume getting a partially-downloaded file
|
||
--start-pos=OFFSET start downloading from zero-based position OFFSET
|
||
--progress=TYPE select progress gauge type
|
||
--show-progress display the progress bar in any verbosity mode
|
||
-N, --timestamping don't re-retrieve files unless newer than local
|
||
--no-if-modified-since don't use conditional if-modified-since get requests in timestamping mode
|
||
--no-use-server-timestamps don't set the local file's timestamp by the one on the server
|
||
-S, --server-response print server response
|
||
--spider don't download anything
|
||
-T, --timeout=SECONDS set all timeout values to SECONDS
|
||
--dns-timeout=SECS set the DNS lookup timeout to SECS
|
||
--connect-timeout=SECS set the connect timeout to SECS
|
||
--read-timeout=SECS set the read timeout to SECS
|
||
-w, --wait=SECONDS wait SECONDS between retrievals (applies if more then 1 URL is to be retrieved)
|
||
--wait retry=SECONDS wait 1..SECONDS between retries of a retrieval (applies if more then 1 URL is to be retrieved)
|
||
--random-wait wait from 0.5WAIT…1.5WAIT secs between retrievals(applies if more then 1 URL is to be retrieved)
|
||
```
|
||
|
||
### Wrapping Up
|
||
|
||
I hope this guide helps you to fix the wget error in your Linux distros. The apparent solution is quite simple.
|
||
|
||
Drop a note below if it helps/or if you have any questions.
|
||
|
||
[Reference][3]
|
||
|
||
--------------------------------------------------------------------------------
|
||
|
||
via: https://www.debugpoint.com/wget-not-found-error/
|
||
|
||
作者:[Arindam][a]
|
||
选题:[lkxed][b]
|
||
译者:[译者ID](https://github.com/译者ID)
|
||
校对:[校对者ID](https://github.com/校对者ID)
|
||
|
||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||
|
||
[a]: https://www.debugpoint.com/author/admin1/
|
||
[b]: https://github.com/lkxed
|
||
[1]: https://www.debugpoint.com/category/distributions
|
||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Sample-example-of-how-to-use-wget.jpg
|
||
[3]: https://www.gnu.org/software/wget/
|