goreplay
goreplay copied to clipboard
deb / rpm install failed & go get : cannot parse import comment
At the beginning, I wanted to install gor by the package you provided (like deb and rpm) but I got an error like this: In Ubuntu 18.04 server:
$ dpkg -i gor_v1.2.0_amd64.deb
dpkg: error processing archive gor_v1.2.0_amd64.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 2 package 'gor':
error in 'Version' field string 'v1.2.0': version number does not start with digit
Errors were encountered while processing:
gor_v1.2.0_amd64.deb
and in Fedora 32 server:
$ rpm -i gor-v1.2.0-1.x86_64.rpm
软件包 gor-v1.2.0-1.x86_64 是针对 different 操作系统的
It said this package is aimed at a different OS.
So, I followed your document for tutorials of Compilation, but I got another error problem.
When I used go get
:
$ go get github.com/buger/gor
buger/gor/input_raw.go:12:2: /root/gocode/src/github.com/buger/goreplay/capture/doc.go:1: cannot parse import comment
buger/gor/input_raw.go:15:2: /root/gocode/src/github.com/buger/goreplay/tcp/doc.go:1: cannot parse import comment
and then:
$ go build LDFLAGS = -ldflags "-extldflags \"-static\""
can't load package: package LDFLAGS: cannot find package "LDFLAGS" in any of:
/usr/lib/go-1.10/src/LDFLAGS (from $GOROOT)
/root/gocode/src/LDFLAGS (from $GOPATH)
can't load package: package =: cannot find package "=" in any of:
/usr/lib/go-1.10/src/= (from $GOROOT)
/root/gocode/src/= (from $GOPATH)
can't load package: package -ldflags: cannot find package "-ldflags" in any of:
/usr/lib/go-1.10/src/-ldflags (from $GOROOT)
/root/gocode/src/-ldflags (from $GOPATH)
can't load package: package -extldflags "-static": cannot find package "-extldflags \"-static\"" in any of:
/usr/lib/go-1.10/src/-extldflags "-static" (from $GOROOT)
/root/gocode/src/-extldflags "-static" (from $GOPATH)
Whatever OS I used, I got the same compilation result. Therefore, I can not install gor with any way. Please what's wrong with it? Thanks!
Operating environment:
- Fedora 32 with go v1.14.13 linux/amd64
- Ubuntu 18.04 with go v1.10.4 linux/amd64
@nl8590687 install libpcap and do git clone
instead of go get
.
go build .
without any flag will be enough and those errors will be fixed.
It works, the problem is solved, thank you!
Seeing same issue with built deb as an FYI - from
error in 'Version' field string 'v1.2.0': version number does not start with digit
Reproduced on ubuntu version
/tmp# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
And reproduced via
cd /tmp
wget https://github.com/buger/goreplay/releases/download/v1.2.0/gor_v1.2.0_amd64.deb
dpkg --install gor_v1.2.0_amd64.deb
You appear to have a malformed .deb configuration
use dpkg --force-bad-version -i
can fix it.
the deb packaging is irregular