Difference between revisions of "Wget installation"
(→Build from Source: Write section.) |
|||
Line 25: | Line 25: | ||
TODO | TODO | ||
==== Building the Binary === | ==== Building the Binary ==== | ||
Inside the source code directory execute | Inside the source code directory execute | ||
Revision as of 11:13, 5 January 2017
This article outlines the procedure to install Wget on your system. You only need to follow the instructions for your platform.
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 -xf 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
TODO
Building the Binary
Inside the source code directory execute
./configure --prefix=/usr --sysconfdir=/etc make
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.
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.
- Install Wget
- Right-click My Computer and select Properties
- Select Advanced System Settings from the left
- Click the Environment Variables button in the bottom-right corner
- Under System Variables, find the Path variable and click Edit
- 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;
- When done, click OK through all the dialog boxes you opened
- The changes should apply immediately under Windows 7. Older versions may require a reboot.
- To test the settings, open a command prompt and enter "wget".