
This tutorial explains how to install Wget on Ubuntu 26.04 in two ways. Wget (short for “World Wide Web get”) is an open-source command-line utility used for retrieving content and files from web servers. It is part of the GNU Project and is designed for non-interactive use, meaning it can operate in the background without user intervention. There are many features offered by Wget, such as recursive download, Robustness, non-interactive operation, bandwidth control, different protocol support, etc.
The time required to install Wget depends on how we will use it. Let’s find out!
Table of Contents
Prerequisites
- A server with Ubuntu 26.04 as the OS
- User privileges: root or non-root user with sudo privileges
Update the System
Update the system packages to their latest available versions before you start with the Wget installation:
apt update -y && apt upgrade -y
Installing Wget from the Ubuntu default repository
Installing wget from the default Ubuntu 26.04 repository is the easiest, safest, and fastest way. To install it, execute the following command:
apt install wget -y
Now that we’ve installed it, check the wget version with the command below:
wget -V
Finally, you should get output similar to this:
root@host:/opt# wget -V
GNU Wget 1.25.0 built on linux-gnu.
-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls
+ntlm +opie +psl +ssl/gnutls
Wgetrc:
/etc/wgetrc (system)
Locale:
/usr/share/locale
Compile:
.
.
.
.
.
Installing Wget from source
Building from source on Linux is a process where users compile human-readable code into machine-executable binaries directly on their own systems. While most modern Linux distributions provide pre-built binary packages, building from source remains a vital practice for several reasons, including hardware optimization, access to specific or latest versions not available in the repository, customization and control, security, and auditing.
Firstly, we will install some dependencies necessary for the compilation process:
apt install gettext curl tar build-essential libssl-dev -y
Secondly, we should download and install the latest stable version of the next-generation Wget, Wget2.
To download the wget2 source code:
curl -O https://ftp.gnu.org/gnu/wget/wget2-2.1.0.tar.gz
Once downloaded, extract the file and enter it into the wget directory:
tar xvf wget2-2.1.0.tar.gz
cd wget2-2.1.0/
Afterward, we should configure the source code:
./configure
Compile the source code:
make
Next, install the compiled wget executable:
make install
After you’ve completed this process, we need to make a symbolic link:
ln -s /usr/local/bin/wget2 /usr/bin/wget2
To check the installed wget version:
wget -V
You should get the following output:
GNU Wget2 2.1.0 - multithreaded metalink/file/website downloader
+digest +https +ssl/openssl +ipv6 +iri +large-file +nls -ntlm -opie -psl -hsts
+iconv -idn -zlib -lzma -brotlidec -zstd -bzip2 -lzip -http2 -gpgme
Copyright (C) 2012-2015 Tim Ruehsen
Copyright (C) 2015-2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please send bug reports and questions to .
Useful Wget commands
1. Download a single file
wget https://yourdomain.com/file.zip
2. Download and save with a different name
wget -O newname.zip https://yourdomain.com/file.zip
3. Resume an interrupted download
wget -c https://yourdomain.com/file.zip
4. Download in the background
wget -b https://yourdomain.com/file.zip
5. Limit download speed
wget --limit-rate=500k https://yourdomain.com/file.zip
6. Download multiple files from a list
wget -i urls.txt
7. Mirror a website
wget -m https://yourdomain.com
8. Recursive download with depth limit
wget -r -l 2 https://yourdomain.com
9. Download only specific file types
wget -r -A .pdf https://yourdomain.com
10. Reject certain file types
wget -r -R .jpg,.png https://yourdomain.com
11. Download with authentication
wget --user=username --password=password https://yourdomain.com/file.zip
12. Download via FTP
wget ftp://yourdomain.com/file.zip
13. Use a proxy
wget -e use_proxy=yes -e http_proxy=http://proxy:port
https://yourdomain.com
14. Download quietly (no output)
wget -q https://yourdomain.com/file.zip
15. Show download progress bar
wget --show-progress https://yourdomain.com/file.zip
Bringing it All Together
That’s it. You successfully installed Wget on Ubuntu 26.04 OS in two different ways.
Of course, you don’t have to install Wget on Ubuntu 26.04 if you have difficulties and you are not familiar with Linux. You can always contact our technical support. You only need to sign up for one of our monthly management plans and submit a support ticket. We are available 24/7 and will take care of your request immediately.
If you liked this post about installing Wget on Ubuntu 26.04, please share it with your friends or leave a comment down below.