Installing or updating to latest wget

Quick commands to install/update wget

wget http://ftp.gnu.org/gnu/wget/wget-1.19.tar.gz
tar -xzf wget-1.19.tar.gz
cd wget-1.19
yum install gcc-c++.x86_64
yum install gnutls-c++.x86_64
yum install gnutls-devel.x86_64
./configure
make && make install
# logout and login again in order to test wget --version

More info on each command

For some reason many linux distributions don't contain latest version of wget and even searching with yum search wget or apt-cache search wget will not show you latest version.

Some useful options of wget like --timeout can fail silently in version like 1.14 and this can cause bugs in more complex scripts or programs. You need to manually update wget in order to make sure latest options work.

First check your current version:

wget --version
GNU Wget 1.14 built on linux-gnu.

Download latest wget from http://ftp.gnu.org/gnu/wget/, e.g wget-1.19.tar.gz

You can put the .tar.gz file on your server by FTP or download it with your existent wget:

wget http://ftp.gnu.org/gnu/wget/wget-1.19.tar.gz

Extract and go to directory

tar -xzf wget-1.19.tar.gz
cd wget-1.19

install these dependencies that are required when compiling:

yum install gcc-c++.x86_64
yum install gnutls-c++.x86_64
yum install gnutls-devel.x86_64

Configure and install wget

./configure
make && make install

!!! You need to re-login to ssh or do a server rstart in order to show new version

test your current version with:

wget --version
GNU Wget 1.19 built on linux-gnu.