How to install and use pup from golang?

I installed go through snap; now how do I invoke pup?

thufir@dur:~/pup$
thufir@dur:~/pup$ go get
thufir@dur:~/pup$
thufir@dur:~/pup$ curl "" | pup 'div.tides' >out.html % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Command 'pup' not found, but there are 17 similar ones.
100 268 100 268 0 0 740 0 --:--:-- --:--:-- --:--:-- 740
(23) Failed writing body
thufir@dur:~/pup$
thufir@dur:~/pup$ cat out.html
thufir@dur:~/pup$
thufir@dur:~/pup$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic
thufir@dur:~/pup$ 

Not sure that it's installed or not, actually:

thufir@dur:~/pup$
thufir@dur:~/pup$ go list
can't load package: package .: no Go files in /home/thufir/pup
thufir@dur:~/pup$
thufir@dur:~/pup$ go version
go version go1.11.4 linux/amd64
thufir@dur:~/pup$ 

It looks interesting in and of itself. My info is:

thufir@dur:~/pup$
thufir@dur:~/pup$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/thufir/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/thufir/go"
GOPROXY=""
GORACE=""
GOROOT="/snap/go/3095"
GOTMPDIR=""
GOTOOLDIR="/snap/go/3095/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build303962824=/tmp/go-build -gno-record-gcc-switches"
thufir@dur:~/pup$ 

I tried running pup from the ~/go/ but got the same result.

1 Answer

I have the same issue trying to install pup.

Steps you have to follow:

  1. export GOROOT=/usr/bin/go (path found running whereis go)
  2. Go to your GOPATH:

    cd /home/thufir/goThere you will find a bin folder and inside the pup binary

  3. Copy binary pup to /usr/bin/

    sudo cp pup /usr/bin

  4. Check if pup is correctly installed

    pup --version

    I hope it works.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like