Wget is a tool created by the GNU Project to retrieve content from various locations over the Internet. Wget is programmed or created in C language and is used on any UNIX/Linux operating system.
Also, wget is compatible with different OSes, such as MacOS and Windows, which make it compatible as a computer tool. In this blog post, we will install and provide you with some useful Wget commands.
In this tutorial, we are going to explain in step-by-step detail how to install and use Wget on Ubuntu 22.04 OS. Let’s get started!
Table of Contents
Prerequisites
- A server with Ubuntu 22.04 as OS
- User privileges: root or non-root user with sudo privileges
Step 1. Update the System
Before we start with the installation of Wget we need to update the system packages to the latest versions available.
sudo apt-get update -y && sudo apt-get upgrade -y
Step 2. Install Wget
Wget is, by default, included in the Ubuntu 22.04 repository. To install the wget software tool execute the following command:
sudo apt-get install wget
After installation, you can check the installed wget version with the command below:
wget --version
You should receive output with the Wget version and some info about wget:
root@host:~# wget --version GNU Wget 1.21.2 built on linux-gnu. -cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls +ntlm +opie +psl +ssl/openssl Wgetrc: /etc/wgetrc (system) Locale: /usr/share/locale Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" -DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib -I../../lib -Wdate-time -D_FORTIFY_SOURCE=2 -DHAVE_LIBSSL -DNDEBUG -g -O2 -ffile-prefix-map=/build/wget-8g5eYO/wget-1.21.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall Link: gcc -DHAVE_LIBSSL -DNDEBUG -g -O2 -ffile-prefix-map=/build/wget-8g5eYO/wget-1.21.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -lpcre2-8 -luuid -lidn2 -lssl -lcrypto -lz -lpsl ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a Copyright (C) 2015 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. Originally written by Hrvoje Niksic . Please send bug reports and questions to .
Step 3. How to use Wget
Let’s explain how you can download some installation with the wget command:
wget options name_of_remote_file OR URL
It is very simple, right? Now, let’s download it first without any options.
wget https://wordpress.org/latest.zip
If you want to download WordPress in the background, you can use the same command with -b as an option.
wget -b https://wordpress.org/latest.zip
If you are not sure that the download process will finish due to connection interruption, then you can use the -c option.
wget -c https://wordpress.org/latest.zip
If you want to specify the destination directory for your downloaded file, you can use the -p option.
wget -p /opt https://wordpress.org/latest.zip
These are the most used wget options, but if you want to know more about the Wget command and its possibilities, you can execute the following:
man wget
There is a complete description of the Wget command:
root@host:~# man wget WGET(1) GNU Wget WGET(1) NAME Wget - The non-interactive network downloader. SYNOPSIS wget [option]... [URL]... DESCRIPTION GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant user's presence, which can be a great hindrance when transferring a lot of data. Wget can follow links in HTML, XHTML, and CSS pages, to create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the links in downloaded files to point at the local files, for offline viewing.
That’s it. You just learned how to install and use Wget on Ubuntu 22.04. If you find this setup difficult, feel free to contact our technical support, and they will help you with this immediately. We are available 24/7. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket.
If you liked this about installing Wget on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below.