Wget installation

From Archiveteam
Jump to: navigation, search

This article outlines the procedure to install Wget on various operating systems.

Linux

Some distributions will preinstall Wget. You can check for an installed version by running wget --version in a shell. It will either report an error or provide you with an output stating the version number on the first line.

Install from distribution

Most likely your distribution provides a package for Wget, even if it was not installed by default. The exact command to install it will depend on your distribution:

  • Arch Linux: sudo pacman -S wget
  • Debian/Ubuntu: sudo apt-get install wget
  • Fedora: sudo yum install wget
  • OpenSuse: sudo zypper install wget

Build from source

If you'd prefer to build Wget from source or there really is no package for your distribution, you can compile the source code yourself.

Getting the source

You can either grab the most recent release from the official download page, at the time of writing this is wget-1.18.tar.gz, and unpack it by executing tar -xfz wget-1.18.tar.gz in the directory you downloaded it to.

Or you can download the latest development version using GNU Bazaar. Assuming you have GNU Bazaar execute bzr branch bzr://bzr.savannah.gnu.org/wget/trunk and it will download the latest development version into a directory called trunk. After donwloading the code from the GNU Bazaar repository, you have to invoke the bootstrap script which will download some additional code that is required: cd trunk; ./bootstrap.

Getting the dependencies

The very first thing you will obviously need is a compilation toolchain.

  • Arch Linux: sudo pacman -S base-devel
  • Debian/Ubuntu: sudo apt-get install build-essential pkg-config
  • On other distributions please consult the documentation.

You need either GnuTLS or OpenSSL on your system to proceed. On Debian/Ubuntu you can install the package libssl-dev, which provides OpenSSL.

If you want PCRE regex support, which many prefer over POSIX regex, you also need to install PCRE. (Debian/Ubuntu: libpcre3-dev)

At this point you should be ready to compile Wget.

Building the binary

Inside the source code directory execute

./configure --prefix=/usr --sysconfdir=/etc
make

Note that Wget uses GnuTLS by default, should you prefer to use OpenSSL append --with-ssl=openssl to the configure command.

If wished you can install it to the directory you specified with --prefix=/usr by executing make install. Note that depending on the directory permissions of your prefix this might require root permissions.

macOS

The Rudix project provides Wget installers for various versions of macOS.

Alternately if you have one of the following package managers installed, it's probably best to install Wget with it:

If you really want to you can also build Wget from source. You need to install Xcode or at least the Command Line Tools, after that you can follow the instructions for building Wget on Linux.

Windows

If you're using Windows 10 and have installed the Windows Subsystem for Linux, you can just follow the instructions above for Ubuntu.

If you are using an older version of Windows or don't wish to install the Windows Subsystem for Linux you can download Wget for Windows, which is part of the GNUWin32 project.

After installation, you will probably want to add it to your Path so that you can run it directly from the command prompt instead of specifying its absolute file path (i.e. "wget" instead of "C:\Program Files\GNUWin32\bin\wget.exe").

These are the instructions for Windows 7 users. Prior versions should be relatively similar.

  1. Install Wget
  2. Right-click My Computer and select Properties
  3. Select Advanced System Settings from the left
  4. Click the Environment Variables button in the bottom-right corner
  5. Under System Variables, find the Path variable and click Edit
  6. Carefully insert the path to Wget's bin folder followed by a semi-colon. Getting this wrong could cause some nasty system problems
    • Your Wget path should be inserted like this: C:\Program Files\GnuWin32\bin;
  7. When done, click OK through all the dialog boxes you opened
  8. The changes should apply immediately under Windows 7. Older versions may require a reboot.
  9. To test the settings, open a command prompt and enter "wget".