centos下go语言编译bettercap

1.设置go环境变量 vi /etc/profile

export GOROOT=/opt/go

export GOPATH=/opt/gopath

# Enable the go modules feature

export GO111MODULE=on

# Set the GOPROXY environment variable

export GOPROXY=https://mirrors.aliyun.com/goproxy/

export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

source /etc/profile后注销重新登陆生效

2.vscode安装gotests等模块

在GOPATH下安装模块,必须保证GOPATH路径有当前用户的读写权限,否则报错

可设置GOPATH=/home/用户名/gopath

3.安装libpcap,libusb

build-essential yum install make automake gcc gcc-c++ kernel-devel或

yum groupinstall "Development Tools" "Development Libraries"

libpcap yum -y install libpcap

libudev on centos and ubuntu - 龙行天下,畅通无阻 - 博客园

            yum install systemd-devel

libusb 

On CentOS7, libusb-1.0 needs the libusbx-devel yum package I believe

yum install libusbx-devel
and you will obviously need the regular libusb package as well

yum install libusb-devel

libnetfilter_queue-devel安装

yum install libnetfilter_queue-devel

 4.编译

go get github.com/bettercap/bettercap

cd $GOPATH/src/github.com/bettercap/bettercap

make build

报错 unrecognized relocation (0x2a)

go 编译出现unrecognized relocation (0x2a) in section `.text` - 知乎

sudo make install

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值