Merge pull request #27955 from geekpi/translating

translated
This commit is contained in:
geekpi 2022-11-16 08:50:17 +08:00 committed by GitHub
commit a8cac421e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 119 additions and 119 deletions

View File

@ -1,119 +0,0 @@
[#]: 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
======
**Heres 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. Its 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 its 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/

View File

@ -0,0 +1,119 @@
[#]: 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: " "
如何修复“bash wget Command Not Found” 错误
======
**以下是你如何在 Debian、Ubuntu 和其他发行版中修复 “bash: wget command not found” 的错误。**
著名的 wget 工具被用来通过终端从 URL 下载任何文件。它是 Linux 终端中最流行和最快速的工具之一。
作为一个 GNU 工具wget 带来了一些奇妙的功能。你可以实现任何项目,如从网上提取信息、下载文件、暂停/恢复等。
然而,许多 [Linux 发行版][1]在默认安装时并没有附带这个工具。因此,当你想用 wget 下载一些文件时,你会得到 wget 命令未找到的错误。
修复它其实很容易。
### 修复 wget 命令未找到
你所需要做的就是打开终端,运行以下命令来安装 wget。
对于 Ubuntu, Linux Mint, elementaryOS, Debian 和相关发行版:
```
sudo apt install wget
```
Arch Linux
```
pacman -S wget
```
对于 Fedora虽然它默认包括
```
sudo dnf install wget
```
安装后,你可以使用 wget 程序。你也可以通过检查其版本来验证它是否正确安装。
```
wget --version
```
### 如何使用 wget
下面是一些关于如何使用 wget 程序的例子。
命令的语法如下:
```
wget [选项]… [URL]…
```
例如,如果我想下载 Ubuntu 的 ISO 文件,那么我可以运行下面的命令,用直接的 URL 下载。
```
wget https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-desktop-amd64.iso
```
![如何使用 wget 的例子][2]
同样,你也可以使用上述命令下载,或者,通过下面描述的几个开关组合。你也可以通过 `wget --help` 命令得到这个。
```
-t, --tries=NUMBER 设置重试次数为 NUMBER0 为不限)。
--retry-connrefused 即使连接被拒绝,也要重试。
--retry-on-http-error=ERRORS 逗号分隔的 HTTP 错误列表,以便重试。
-O, --output-document=FILE 将文件写入 FILE 中
--nc, --no-clobber 跳过那些会下载到现有文件的下载(覆盖它们)
--no-netrc 不要试图从 .netrc 中获取证书。
-c, --continue 继续已部分下载的文件
--start-pos=OFFSET 从 0 开始 OFFSET 位置开始下载
--progress=TYPE 选择进度表类型
--show-progress 在任何详细模式下显示进度条
--N, --timestamping 不重新检索文件,除非比本地文件新。
--no-if-modified-since 在时间戳模式下不使用条件性的 if-modified-since 获取请求
--no-use-server-timestamps 不以服务器上的时间戳来设置本地文件的时间戳。
--S, --server-response 打印服务器响应
--spider 不下载任何东西
-T, --timeout=SECONDS 设置所有的超时值为 SECONDS
--dns-timeout=SECS 将 DNS 查询超时设置为 SECS
--connect-timeout=SECS 将连接超时设置为 SECS
--read-timeout=SECS 设置读取超时为 SECS
--w, --wait=SECONDS 在两次检索之间等待 SECONDS适用于检索的 URL 超过 1个
--wait retry=SECONDS 在检索的重试之间等待1...SECONDS适用于检索的 URL 超过 1 个)。
--random-wait 在两次检索之间等待 0.5WAIT...1.5WAIT 秒(适用于检索的 URL 超过 1 个)
```
### 总结
我希望这个指南能帮助你解决 Linux 发行版中的 wget 错误。明显的方案是非常简单的。
如果有帮助或者你有任何问题,请在下面留言。
[参考][3]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/wget-not-found-error/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者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/