Mac os 下自带的命令行工具不如linux系统多,如wget,安装工具yum,apt-get等,今天在安装软件的时候就发现居然没有wget,虽然可以使用curl -O 来替代,但是习惯了使用wget的我,还是想安装一下,下面就给大家介绍mac下安装wget的方法
1.下载wget
curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz
2.解压
tar -xzvf wget-1.13.4.tar.gz cd wget-1.13.4
3.编译安装
./configure --with-ssl=openssl make sudo make install
4.注意事项
如果在执行./configure的时候没有输入--with-ssl=openssl参数,则可能会遇到如下错误
...
checking for compress in -lz... yes
checking for gpg_err_init in -lgpg-error... no
checking for gcry_control in -lgcrypt... no
checking for libgnutls... no
configure: error: --with-ssl was given, but GNUTLS is not available.
username@host:~/wget-1.13.4 $
原因是:
The reason for this is that GNUTLS isn’t included with Mac OS X, but the equally usable library OpenSSL is available.
参考国外的专家:
https://thomashunter.name/blog/install-wget-on-os-x-lion/