How to uninstall Hugo?

Under Linux (Xubuntu 20.04 here), I have followed the following set of commands:

(installing go from the official website)

sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version

which gives me:
go version go1.19.2 linux/amd64 and then I try to build hugo from source:

git clone https://github.com/gohugoio/hugo.git
cd hugo
go install

which has finished without giving me any problems. However running hugo version gives me command not found: hugo error.
Since I don’t see any binary folders under the hugo directory, I then switched over to the latest tag and tried installing again.
Again no issues, program finishes, and I see no outputs whatsoever.

The problem started with not wanting to use snap packages and I now have a partially installed Hugo which I don’t even know how to remove.

Where are the Hugo binaries or how do I remove Hugo installed with go install?

Hugo should be in $GOPATH/bin

Run this command to see where that is on your system.

echo $GOPATH

There are easier ways to install Hugo, see: Install Hugo | Hugo

I’m on macOS and use Homebrew and then it is just:

brew install hugo

Thanks for the reply.

Unfortunately echo $GOPATH returns nothing.

As with echo $asdfasdf I’m just getting an empty line as a response which means it doesn’t exist.

I also don’t see a bin folder in the Hugo repository that I have cloned :frowning:

Any ideas?

Edit: I have also checked the Go installation directory, /usr/local/go and it doesn’t exist since I didn’t install with sudo go install (it would require that permission).

I will install it directly from .tar.gz from the repos.

The default $GOPATH is $HOME/go I believe. Do you have something there?

1 Like

Bingo!

Yes, I have a go directory there. Out of frustration though I have deleted the repository directly and using a prepackaged binary.

For future reference, people should do:

export PATH=$PATH:/$HOME/go/bin

I have deleted the original repository. Also deleting this $HOME/go folder. Is there anywhere else I should pay attention to?

Edit: $HOME/go/bin directory alone was 1 GB whereas the original hugo DEB package was only 16.8 MBs

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.