栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

手动编译源代码安装wget

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

手动编译源代码安装wget

 从wget的源代码入手,来完成wget在Ubuntu上的安装,如果你的机器上已经默认安装了wget,请采用apt-get remove命令先卸载掉。

解决configure: error: –with-ssl was given, but GNUTLS/SSL is not available.;解决error: ./stdio.h:1012: error: ‘gets’ undeclared here (not in a function)

  • 源码下载命令

curl -o wget-1.13.4tar.xz ftp://ftp.gnu.org/gnu/wget/wget-1.13.4tar.xz

  • 解压缩

tar -zxvf wget-1.13.4.tar.xz

  • 执行./configure配置

进入wget目录后,执行./configure命令,我运行configure命令后出现了这样的错误:

configure: error: –with-ssl was given, but GNUTLS is not available.

百度了一下解决方法,执行命令./configure –with-ssl=openssl,

结果又出现如下的错误提示:

configure: error: –with-ssl=openssl was given,but ssl is not avaliable.

百度出来说原因可能是虽然openssl安装,但对应的库没有安装,然后按照博主说的:

sudo apt-get install libssl-dev

再次运行

./configure –with-ssl=openssl,正常啦。

  • make编译,这里最好用sudo make,不然容易遇到 permission denied

我在顺利完成configure步骤后,wget的根目录就出现了Makefile文件,这时运行命令make编译,结果又出现如下的问题:./stdio.h:1012: error: ‘gets’ undeclared here (not in a function)

 网上搜了一下,解决方法是到wget目录中,找到stdio.h文件,给它修改权限sudo chmod 777 stdio.h,执行命令“vim stdio.h”,用“1012G”跳到1012行,注意是wget目录(不是Ubuntu系统目录)下的stdio.h文件,然后注释掉stdio.h中的1012行,就是下面我注释掉并且圈出来的这行,保存退出后,再次运行make命令,正常编译。

  • 执行命令sudo make install,没有报错

  • wge -help查看是否安装成功,如图,安装好了

用wget试着下载一张图,如下,成功下载,手动编译wget源代码安装到此结束

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/837770.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号