LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2022, 05:08 PM   #1
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Rep: Reputation: 14
GoLang


hi friends,
Slackware 15.0 has version GO 1.16.5 but I have version 1.17.6 in another directory. even though my version is included in /etc/profile.d/golang.sh, it always takes the system one.
Where can I change this?

Last edited by ndavilam; 02-08-2022 at 05:14 PM.
 
Old 02-09-2022, 01:09 AM   #2
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Did you re-login after installing the newer go?
 
Old 02-09-2022, 04:23 AM   #3
sairum
Member
 
Registered: Sep 2004
Location: Portugal
Distribution: Slackware
Posts: 118

Rep: Reputation: 56
AFAIK Slackware 15.0 does not ship any Go binaries. Either you installed them via SlackBuilds or you used AlienBob's binary package which is currently at version 1.17.5. If you have 1.16.15 it's because you installed it previously. Either remove that package or upgrade it to 1.17.5.

PS: Slackware provides Go through the Gnu compiler (gccgo)

Last edited by sairum; 02-09-2022 at 04:24 AM.
 
Old 02-09-2022, 08:09 AM   #4
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Unhappy

Quote:
Originally Posted by sairum View Post
AFAIK Slackware 15.0 does not ship any Go binaries. Either you installed them via SlackBuilds or you used AlienBob's binary package which is currently at version 1.17.5. If you have 1.16.15 it's because you installed it previously. Either remove that package or upgrade it to 1.17.5.

PS: Slackware provides Go through the Gnu compiler (gccgo)
Hi sairum,
My Slackware installation is clean, I have never installed GO(alienbob or any 3rd party repository).
I have always downloaded GO and put it in a path on my backup disk and add it to /etc/profile.d/golang.sh

And I'm surprised to see in /usr/bin/go
terminal:
go version go1.16.5 gccgo (GCC) 11.2.0 linux/amd64
 
Old 02-09-2022, 08:17 AM   #5
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by nestorv.davilam View Post
hi friends,
Slackware 15.0 has version GO 1.16.5 but I have version 1.17.6 in another directory. even though my version is included in /etc/profile.d/golang.sh, it always takes the system one.
Where can I change this?
Do you put your custom go path at the beginning or end of PATH? Can you show us your golang.sh?

/usr/bin/go is provided by gcc-go (a stock Slackware package), as already pointed out by sairum.

I suppose you could "removepkg gcc-go" if you want to get rid of GCC's go implementation (I didn't try this!).
 
Old 02-09-2022, 08:21 AM   #6
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by drumz View Post
Do you put your custom go path at the beginning or end of PATH? Can you show us your golang.sh?

/usr/bin/go is provided by gcc-go (a stock Slackware package), as already pointed out by sairum.

I suppose you could "removepkg gcc-go" if you want to get rid of GCC's go implementation (I didn't try this!).
I'll try something, I think it could be the name of the variable, I'm assuming.
Maybe the system is reading GOROOT/GOPATH and mine is GO_HOME.
 
Old 02-09-2022, 08:31 AM   #7
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Talking

Quote:
Originally Posted by drumz View Post
Do you put your custom go path at the beginning or end of PATH? Can you show us your golang.sh?

/usr/bin/go is provided by gcc-go (a stock Slackware package), as already pointed out by sairum.

I suppose you could "removepkg gcc-go" if you want to get rid of GCC's go implementation (I didn't try this!).
No, my stupid idea didn't work.
 
Old 02-09-2022, 08:40 AM   #8
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by nestorv.davilam View Post
No, my stupid idea didn't work.
You still didn't show us your /etc/profile.d/golang.sh.
 
Old 02-09-2022, 08:41 AM   #9
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by drumz View Post
You still didn't show us your /etc/profile.d/golang.sh.
Sorry,

export GOROOT=/mnt/Backup/Tools/go
export PATH="$PATH:$GOROOT/bin"
 
Old 02-09-2022, 08:43 AM   #10
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by nestorv.davilam View Post
Sorry,

export GOROOT=/mnt/Backup/Tools/go
export PATH="$PATH:$GOROOT/bin"
Change it to:

Code:
export GOROOT=/mnt/Backup/Tools/go
export PATH="$GOROOT/bin:$PATH"
 
1 members found this post helpful.
Old 02-09-2022, 08:45 AM   #11
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by drumz View Post
Change it to:

Code:
export GOROOT=/mnt/Backup/Tools/go
export PATH="$GOROOT/bin:$PATH"
I'll try and let you know how it goes
 
Old 02-09-2022, 08:48 AM   #12
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by drumz View Post
Change it to:

Code:
export GOROOT=/mnt/Backup/Tools/go
export PATH="$GOROOT/bin:$PATH"
are you a sorcerer? LoL

Thanks, I hope that this change does not bring consequences.
 
Old 02-09-2022, 08:51 AM   #13
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by drumz View Post
Change it to:

Code:
export GOROOT=/mnt/Backup/Tools/go
export PATH="$GOROOT/bin:$PATH"
But it's weird you know?
Because with the current version of Slackware 15 RC, I had no problems with Go previously
 
Old 02-09-2022, 08:53 AM   #14
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by nestorv.davilam View Post
are you a sorcerer? LoL

Thanks, I hope that this change does not bring consequences.
No, not a sorcerer (wouldn't a sorcerer know if he is one?)

The consequence is that any binary in /mnt/Backup/Tools/go/bin has preference over the rest of your PATH, like /usr/bin, /bin, etc.

Assuming you only have go tools in /mnt/Backup/Tools/go/bin and don't do anything silly like put an executable named "bash" in /mnt/Backup/Tools/go/bin/ you'll be fine.

This preference ordering is why /usr/local/bin comes before /usr/bin in Slackware's default PATH: it assumes anything in /usr/local/bin should take preference over anything in /usr/bin.
 
Old 02-09-2022, 09:04 AM   #15
ndavilam
Member
 
Registered: Oct 2015
Location: Ecuador
Distribution: Slackware
Posts: 62

Original Poster
Rep: Reputation: 14
Another option would be to rebuild http://slackware.uk/slackware/slackw.../source/d/gcc/

This is correct?



Quote:
Originally Posted by drumz View Post
No, not a sorcerer (wouldn't a sorcerer know if he is one?)

The consequence is that any binary in /mnt/Backup/Tools/go/bin has preference over the rest of your PATH, like /usr/bin, /bin, etc.

Assuming you only have go tools in /mnt/Backup/Tools/go/bin and don't do anything silly like put an executable named "bash" in /mnt/Backup/Tools/go/bin/ you'll be fine.

This preference ordering is why /usr/local/bin comes before /usr/bin in Slackware's default PATH: it assumes anything in /usr/local/bin should take preference over anything in /usr/bin.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Install Golang In Linux Using Update-golang Script LXer Syndicated Linux News 0 03-30-2021 01:32 PM
LXer: Golang to the rescue: Saving DevOps from TLS turmoil LXer Syndicated Linux News 0 04-05-2017 04:10 PM
LXer: IBM flexible mainframes with Golang, Mozilla keeps FireFox OS in play for IoT, and more news LXer Syndicated Linux News 0 01-19-2016 10:14 PM
LXer: code churning and golang LXer Syndicated Linux News 0 11-03-2014 01:41 PM
Setting Environment Variables for Google GoLang vital_101 Ubuntu 1 11-12-2009 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration