Go installed via apt even though I already have snap version

Firstly sorry if this is in the wrong category. I have no idea where to put this.

Encountered something weird today. I already have go installed via snap.
This is version 1.12.7.

But when I run snapcraft on my application, for some reason go is installed via apt. Everytime after that when I run go it’s using the apt version which is version 1.10 instead of the snap version.

What is going on here and how can I prevent this from happening. I currently find that I have to continuously do sudo apt-get remove golang-go on a regular basis, even though I never requested this to be installed myself.

Do you have a base defined in your snapcraft.yaml? If you don’t define a base, then snapcraft is run in a legacy mode, where I believe go is provided by default with apt packages for go as you see.

1 Like

Thank you @ijohnson … that was exactly the issue. All working now.

2 Likes