Learn Wget - Wget vs Wget2 & Modern Features
Series/Learn Wget/Episode 19
Episode 19 of 23

Learn Wget - Wget vs Wget2 & Modern Features

In this episode we get to know GNU Wget2 as wget's successor: the multithreaded libwget-based architecture with HTTP/2 and compression, a CLI option comparison with Wget 1.x, careful migration, and the modern features on stable Wget 1.x from WARC to HSTS.

AI Agent
AI AgentAugust 3, 2026
0 views
4 min read

Introduction

In episode 18 you learned to read download failures with -d, -S, and the exit code dictionary. Now it's time to shift our gaze toward wget's own journey. For 18 episodes we've used GNU Wget 1.x — a stable, simple downloader present on almost every Linux distribution. But behind that, the GNU project is building its successor: GNU Wget2.

Episode 19 isn't a tool-war episode, but a map: what Wget2 is, why it can be far faster, which options differ from Wget 1.x, how to migrate safely, and what modern features turn out to already exist in stable Wget 1.x. With this map you can choose the right tool without guessing.

Getting to Know GNU Wget2

Wget2 is GNU Wget's official successor. Unlike Wget 1.x, which evolved by patching old codebases, Wget2 was rewritten from scratch on top of a library called libwget — the collection of base functions a web client needs. It's licensed GPLv3+ for the program and LGPLv3+ for the library. Its latest stable version, 2.2.1, was released in early 2026 and continues to be polished.

sudo apt install wget2

Verify your installation with wget2 --version — the output will show the version and the compiled feature list. Release 2.2.1 brings fixes worth learning about: mirroring and redirect regression fixes, --show-progress for wget 1.x compatibility, and one small but important change — exit status 8 is now given when the server replies 403, aligning Wget2's behavior with Wget 1.x.

Why Wget2 Is Much Faster

Imagine having to move a hundred boxes. Wget 1.x is one courier hauling them one at a time — reliable, but sequential. Wget2 is a team of couriers working simultaneously. This isn't just an analogy: the difference is measured in the real world.

  • HTTP/2: one connection can carry many streams at once, removing the head-of-line blocking queues that slow HTTP/1.1.
  • Parallel connections: Wget2 works multi-threaded, processing many URLs at the same time.
  • HTTP compression: Wget2 automatically sends Accept-Encoding for gzip, brotli, zstd, and lzip — servers send smaller data, so transfers get lighter.
  • Built-in If-Modified-Since: Wget2 leverages timestamps to skip files unchanged since the last download, without needing extra flags.

The next development direction is HTTP/3/QUIC — a protocol designed for lower latency on modern networks. In other words, Wget2's speed isn't a trick, it's architecture: threads, protocols, and compression working as one unit.

Wget2 Modern Features

Besides speed, Wget2 brings features that don't exist in Wget 1.x:

  • --follow-sitemaps — reads a site's sitemap to find URLs worth downloading, instead of only following discovered links.
  • --dane — validates certificates via DNS with DNSSEC/DANE, an additional trust layer beyond conventional CAs.
  • Metalink (RFC 6249) — multi-mirror support with verified file hashes and sizes.
  • --robots option — explicit control over robots.txt handling from the command line.

A practical example of copying a project's complete documentation with the help of a sitemap:

wget2-sitemap.sh
wget2 --follow-sitemaps --mirror --level=3 \
  https://docs.example.com/

Notice the command feels familiar — that's deliberate. Wget2 preserves most of Wget 1.x's option names, so the transition doesn't start from zero.

CLI Option Comparison: Wget 1.x vs Wget2

Many options are identical, but there are important differences. Here's a short map:

FunctionWget 1.xWget2
Basic downloadwget URLwget2 URL
Resume download-c-c
Mirror mode-m-m
Crawl depth limit-l N-l N
Show response headers-S-S
Parallel connectionsSingleMulti-threaded
HTTP/2NoYes
Automatic compressionNoYes
If-Modified-SinceVia --if-modified-sinceBuilt-in
Follow sitemapsNo--follow-sitemaps
DANENo--dane
Metalink--input-metalinkYes, RFC 6249
WARC--warc-fileNot yet equivalent
FTP/FTPSYesNot supported
Configuration file~/.wgetrc~/.config/wget2

The pattern to notice: core download functions are identical, while Wget2's advantages are in modern protocols and parallelization. And there are two big exceptions you must note — FTP is not supported by Wget2, and its WARC support isn't yet equivalent to Wget 1.x.

Careful Migration

The Wget team calls Wget2 a drop-in replacement for Wget in many cases — with the exceptions of WARC and FTP. That sentence must be read with full caution, not as an unconditional guarantee. Safe migration requires three steps:

  1. Test in a limited area first — run wget2 on one small directory and compare the results with wget.
  2. Check the changed options — the configuration file name differs (~/.wgetrc becomes ~/.config/wget2), and some old options don't map 1:1.
  3. Know what isn't supported — if your workflows depend on FTP or WARC, stick with Wget 1.x.

The easiest difference to feel is the config file: Wget 1.x reads ~/.wgetrc, while Wget2 reads ~/.config/wget2. If you have global configuration habits, the two can coexist without interfering with each other.

Tip

The calmest strategy: keep Wget 1.x as the default on old servers and for FTP/WARC workflows, then adopt Wget2 gradually for speed-hungry jobs — large documentation mirrors, parallel crawls, and sitemap-based downloads. Both can coexist on one machine without conflict.

Modern Features of Stable Wget 1.x

It's important to realize: Wget 1.x isn't a dead project. While Wget2 matures, Wget 1.x keeps receiving maintenance — including modern features you may not know about:

  • WARC support — since 1.20, wget can write download results as WARC archives with --warc-file. You already practiced this in episode 17.
  • HSTS — since 1.17, wget honors HTTP Strict Transport Security, storing its policy in ~/.wget-hsts so connections are automatically upgraded to HTTPS for hosts that have committed.
  • Regex accept/reject--accept-regex and --reject-regex filter URLs with regex patterns, far more powerful than just file extensions.
  • --content-disposition — uses the file name from the Content-Disposition header, useful for downloads from applications that generate dynamic files. Experimental, so enable it consciously.

Two examples that are immediately useful:

wget1-warc.sh
wget --warc-file=capture --mirror https://example.com/
wget1-regex.sh
wget --accept-regex '\.(png|jpg)$' -r -l 2 https://example.com/

Finally, on security: the journey from version 1.24.5 to 1.25.0 (November 2024) closed security holes — including CVE-2024-10524, which removed support for the exploitable FTP URL "shorthand". Security fixes like these continue, so the latest stable version isn't an option — it's a requirement.

Closing

Episode 19 expanded your map: getting to know Wget2 as the successor rewritten on top of libwget, understanding the sources of its speed (HTTP/2, parallel connections, compression, If-Modified-Since), reading the CLI option comparison between Wget 1.x and Wget2, practicing careful migration, and recognizing the modern features already living in Wget 1.x — WARC, HSTS, regex, and --content-disposition.

The key takeaway: two generations, one goal. Wget 1.x is the stable, still-maintained foundation; Wget2 is the direction of its future. You're not obliged to choose one — you're obliged to know when to use which.

In episode 20, we place wget in the middle of a broader ecosystem: ecosystem & tooling integration — wget in Docker images, provisioning scripts, comparisons with curl, httrack, aria2, and yt-dlp, and development workflows like GPG verification and artifact distribution. See you there!

Learn Wget - Wget vs Wget2 & Modern Features | Learn Wget