以下记录下我在安装zmap的过程中遇到的问题和自己收集并实践的安装方法。
一、配置一下系统的yum源
建议最好配置一下,天知道拿到手的服务器yum源是否好使。
- cd /etc/yum.repos.d
- mv CentOS-Base.repo CentOS-Base.repo.bak #备份旧的配置文件
- wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #下载阿里源的文件
- yum clean all #清理缓存
- yum makecache #重新生成新的缓存2
二、yum makecache 这一步出错的解决方法
- rpm -qa|grep yum ,列出系统安装的yum依赖包
- rpm -e "yum-xxxxx" --nodeps ,逐一删除("yum-xxxxx" 表示yum依赖包的名称,--nodeps表示不检查依赖关系)
- cat /etc/redhat-release ,查看自己的系统版本,我的是CentOS Linux release 7.2.1511 (Core)
- 下载yum依赖包,注意版本对应
- wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm- 安装yum依赖包
- rpm -ivh yum-*
三、安装zmap依赖包
- yum install cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel
- 提示找不到gengetopt
wget ftp://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz
tar -zvxf gengetopt-2.22.6.tar.gz
cd gengetopt-2.22.6
./configure
make
make install
- 执行make命令提示make: command not found
- yum -y install gcc automake autoconf libtool make
- 如果提示g++: command not found
- yum -y install gcc+ gcc-c++
四、通过git指令克隆zmap的源码
- 如果没有安装git,执行命令
- yum install git
- git clone https://github.com/zmap/zmap
cd zmap/
cmake .
make -j4
make install- zmap -h 测试是否安装成功