目录
一、yum 安装
尝试用 yum 安装,无法找到匹配的包:
# yum install wget
Last metadata expiration check: 1:53:45 ago on Wed 08 Jun 2022 10:15:37 PM CST.
No match for argument: wget
Error: Unable to find a match: wget
https://ftp.gnu.org/gnu/wget/
以下改为下载包安装的方式。
二、下载包安装 wget
涉及 gmp、nettle、gnutls、wget 四个包的安装。
1.安装 gmp
(1)下载
下载地址:https://gmplib.org/download/gmp/
(2)解压
xz -d gmp-6.2.1.tar.xz
tar xvf gmp-6.2.1.tar
(3)编译安装
cd gmp-6.2.1
./configure --prefix=/usr/local/
make
make install
2.安装 nettle
(1)下载
下载地址:https://ftp.gnu.org/gnu/nettle/
(2)解压
tar xzvf nettle-3.8.tar.gz
(3)编译安装
cd nettle-3.8
./configure --prefix=/usr --enable-mini-gmp
make
make install
3.安装 gnutls
(1)下载
下载地址:https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/
(2)解压
xz -d gnutls-3.7.6.tar.xz
tar xzvf gnutls-3.7.6.tar
(3)编译安装
cd gnutls-3.7.6
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit
make
make install
4.安装 wget
(1)下载
下载地址:https://ftp.gnu.org/gnu/wget/
(2)解压
tar xzvf wget-latest.tar.gz
(3)编译安装
cd wget-1.21.3
./configure
make
make install
执行过程可能报错:
configure: error: Package requirements (gnutls) were not met:
Package 'gnutls', required by 'virtual:world', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GNUTLS_CFLAGS
and GNUTLS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
解决方法:
编译安装 gnults 前,记得设置以下环境变量:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
可通过以下命令查看是否存在相应的包:
pkg-config --list-all
三、下载包安装 wget2
相较于 Wget,Wget2 速度更快,支持更多的协议,特别是围绕 HTTP/2 和压缩,支持多线程/并行连接,以及其他改进。
(1)下载
下载地址:https://ftp.gnu.org/gnu/wget/
(2)解压
tar xzvf wget2-latest.tar.gz
(3)编译安装
cd wget2-2.0.1
./configure
make
make install