How to install wget on CentOS 8 using the yum/dnf command

last updated in Categories , ,

I am a new CentOS Enterprise Linux 8 user. How do I install wget on CentOS 8 using the dnf command or yum command?

Introduction – GNU/wget is a free and open source software package for getting files using HTTP, HTTPS, and FTP Internet protocols. The GNU/wget might not be installed on your CentOS 8 based desktop or server. For example, if you try to use the wget command on CentOS 8, you will get an error that read as follows:

bash: wget: command not found

This page explains how to set up wget on CentOS 8 using yum command/dnf command.

How to install wget on CentOS 8

The procedure to install wget command is as follows on CentOS Linux 8:

  1. Open a terminal window.
  2. Search for wget package on CentOS Enterprise Linux 8, run:
    sudo yum search wget
  3. Run to install wget :
    sudo yum install wget
  4. Verify wget installation, run:
    wget https://www.cyberciti.biz/files/hello-linux-module.zip
  5. Check wget version by running:
    wget --version

Let us see all commands and steps in details to install wget in CentOS 8.

Installing wget command on CentOS 8

First try to locate wget package, run:
$ sudo yum search wget
Sample outputs:

==================================== Name Exactly Matched: wget =====================================
wget.x86_64 : A utility for retrieving files using the HTTP or FTP protocols

Type the following yum command or dnf command
$ sudo dnf install wget
OR
$ sudo yum install wget
How to install wget on CentOS 8 using yum command

How to test wget command

Now you know how to install wget on CentOS 8. It is time to learn how to use it. The syntax is:
wget url
wget https://exampleDotCom/fileName
wget http://url/path.tar.gz
wget [options] urls

How to download a single file using wget

Run the following command:
$ wget https://www.cyberciti.biz/files/tw_cli.8.html
$ wget ftp://ftp.freebsd.org/pub/sys.tar.gz
$ wget -O output.file https://www.cyberciti.biz/files/tw_cli.8.html

You can limit download speed as well:
wget --limit-rate=50k url
It is possible to set username and password while downloading files from password protected area:
wget --http-user=vivek --http-password=Secrete https://url-domain/file.tar.gz
For more info see “Linux wget: Your Ultimate Command Line Downloader

How to resume broken downloads with wget

Again the syntax is as follows:
wget -c url
wget --continue url
wget --continue [options] url

Conclusion

This page explained how to install the wget command using the dnf command or yum command. Further, it also demonstrated basic usage of the wget for command line user. For more info see GNU/wget homepage here.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!