MacBook安装wget几种方式

方式一 (没有安装成功)

官方下载wget源码包: wget-1.19.4.tar.gz

#解压 
tar -zxvf wget-1.19.4.tar.gz

cd wget-1.19.4

./configure #运行配置文件报错,缺少pkg-config或太老

#先安装Xcode,它里面很多插件的
pkg-config —version #查看版本

#先安装pkg-config

终端输入 pig-config —version 看有没有安装

官方下载 pkg-config-0.29.2.tar.gz 最新的包

解压 tar -zxvf pkg-config-0.29.2.tar.gz

cd pkg-config-0.29.2

./configure --with-internal-glib  运行配置文件进行系统配置

make  编译

make check  安装包自检测

sudo make install 安装

pkg-config —version 查看

#重新进入wget 运行配置文件
cd wget-1.19.4

./configure —with-ssl=openssl 还是报错 ,别人评论说要先安装Xcode才能编译过,但我没有成功

上面的方式没有安装成功,选择下面方式安装成功

方式二(brew安装成功)

官方地址: https://brew.sh/index_zh-cn.html

#安装home-brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#wget 安装
brew install wget

#查看版本
wget -V 
#显示如下:
GNU Wget 1.21.1 在 darwin20.2.0 上编译。

-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls 
+ntlm +opie -psl +ssl/openssl 

#卸载homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

#安装homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

你可能感兴趣的:(macbookwget)