## If you don't have Wget installed, you can't use Wget to wget Wget, so
## use something else:
# curl -O ftp://ftp.gnu.org/pub/gnu/wget/wget-1.21.4.tar.lz
# ncftpget ftp://ftp.gnu.org/pub/gnu/wget/wget-1.21.4.tar.lz
#
## or if you don't have ncftpget either and only have commandline 'ftp':
# cat << END | ftp -n ftp.gnu.org
# user anonymous
# pass me@foo.org
# cd /pub/gnu/wget
# binary
# get wget-1.21.4.tar.lz
# close
# quit
# END
# Get it
cd
test -f installed/wget-1.21.4.tar.lz && mv installed/wget-1.21.4.tar.lz .
test ! -f wget-1.21.4.tar.lz &&
wget http://ftpmirror.gnu.org/wget/wget-1.21.4.tar.lz
# The original base64 sha256 checksum from the release announcement:
# (when you don't have coreutils >= 9.2's cksum)
# NoNhml9Q7cvMsXIKeQBvo3v5uaJVqMW0gEi8PHqHS9k=
sha256sum -b wget-1.21.4.tar.lz | xxd -r -p | base64
# Verify tarball w/ sha256sum:
# (this comes from mine, verified above and with gnupg below)
echo "3683619a5f50edcbccb1720a79006fa37bf9b9a255a8c5b48048bc3c7a874b\
d9 wget-1.21.4.tar.lz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "wget-*" -exec rm -r {} \;
tar xvf --lzip ~/wget-1.21.4.tar.lz
cd wget-1.21.4
test $UID = 0 && chown -R root:root .
# If you do have GnuTLS and/or OpenSSL installed, but don't want to build
# in SSL support, which gives you the ability to get https URLs, pass
# --without-ssl to configure below.
#
# To use OpenSSL and not GnuTLS (the default), pass --with-ssl=openssl to
# configure below.
# On a 64-bit server of mine, with OpenSSL installed under the < 1.1.0
# default prefix of /usr/local/ssl, with libraries in ./lib64/ under there,
# configure did find everything without anything extra like LDCONFIG.
#
# If your GnuTLS or OpenSSL is installed in a system-wide (like /usr)
# location, configure should find it automatically. If it can not, you
# can pass these to configure:
# --with-libgnutls-prefix
# --with-libssl-prefix
# The default source-installed location for OpenSSL < 1.1.x would be like this:
# --with-libssl-prefix=/usr/local/ssl
# If you do use IPv6, of course you'll want to leave off --disable-ipv6
# Back up your wgetrc, if you have one:
test -f /etc/wgetrc &&
( mkdir -p -m 0700 ~/backup
cp -a /etc/wgetrc ~/backup/wgetrc-$(date +%Y%m%d) )
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg wget
# There is a sample wgetrc in doc/sample.wgetrc
# To check for the differences between your existing one and the sample
# one, try this:
# diff -u /etc/wgetrc doc/sample.wgetrc
# Install the new wget with stripped binary
make install-strip
## If you changed from a /usr/local wget to a /usr wget, or have scripts
## that are hard-set to /usr/local/bin/wget, create a symlink:
# ln -s /usr/bin/wget /usr/local/bin/wget
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/wget-*.tar.*
mv wget-1.21.4.tar.lz installed/
# If you ever need to uninstall Wget, run this:
su
mkdir -p -m 0700 ~/backup
test -f /etc/wgetrc && mv -f /etc/wgetrc ~/backup/
test -f /usr/local/etc/wgetrc && mv -i /usr/local/etc/wgetrc ~/backup/
for pfx in /usr /usr/local;
do
rm -f ${pfx}/bin/wget ${pfx}/info/wget.info* ${pfx}/man/man1/wget.1
find ${pfx}/share/locale /usr/local/share/locale -type f -name "wget.mo" \
-exec rm {} \; 2> /dev/null
done
exit
find ~/src -maxdepth 1 -name "wget-*" -exec rm -r {} \;
rm -f ~/installed/wget-*.tar.*