尝试在Linux上使用Google的Go,并且我需要一些帮助。

huangapple go评论105阅读模式
英文:

Trying Google's 'Go' for Linux, and I could use some help

问题

我是Linux的新手,所以我正在尝试Ubuntu;我已经安装了Google的Go,想试试看。

但是每次我尝试编译时都会出现:8g:命令未找到。

我很困惑...有人可以帮忙吗?

英文:

I'm new to Linux, so I'm trying Ubuntu; I've installed Google's Go, thought I might give it a try.

Though every-time I try to compile I get:
8g: Command not found

I'm confused.. Any help?

答案1

得分: 2

这部分安装过程在这里部分讨论。

您需要将对应于您的$GOBIN目录添加到您的$PATH中。将以下行(根据您的系统进行调整)添加到您的~/.bashrc文件中:

PATH="$HOME/src/golang/bin:$PATH"

请记住,虽然Go受到Unix的深刻启发,但它并不代表“典型”的Linux体验,目前是Python和C的混合。

英文:

This part of the installation process is partially discussed here.

You need to add what corresponds to your $GOBIN directory to your $PATH. Add the following line (adjusted for your system) to your ~/.bashrc:

PATH="$HOME/src/golang/bin:$PATH"

Keep in mind that while Go is heavily Unix-inspired, it's not representative of the "typical" Linux experience, which at present is a mix of Python and C.

答案2

得分: 1

浏览了你提供的指南,似乎没有将8g等安装到/usr/bin,而是安装到你的主目录中的一个目录中。包含8g的目录是否在你的路径中?

(如果你不确定如何测试,请在终端中输入echo $PATH以获取当前路径列表。如果8g不在你的路径中,请尝试export PATH=$PATH:/my/new/bit,然后再试一次。要使此更改永久生效,你需要编辑你的~/.bashrc文件)

英文:

Glancing through the guide you linked to, it doesn't appear to install 8g etc. to /usr/bin but rather to a directory in your home directory. Is the directory containing 8g in your path?

(If you're not sure how to test this, type echo $PATH in your terminal to get the current path list. If 8g wasn't in your path then try export PATH=$PATH:/my/new/bit and then try again. To make such a change permanent, you'll need to edit your ~/.bashrc)

答案3

得分: 0

Gustavo Niemeyer提供了适用于golang的Ubuntu软件包。安装这些软件包的说明在这里

英文:

There are ubuntu packages for golang provided by Gustavo Niemeyer. Instructions for installing these packages are here.

答案4

得分: 0

如果您使用的是amd64机器,则编译器为6g(链接器为6l)。
您可以通过运行uname -m来查找机器的类型。

英文:

If you are on amd64 machine then the compiler is 6g (and the linker is 6l).
You can find the type of the machine by running uname -m

huangapple
  • 本文由 发表于 2011年4月6日 17:02:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/5563867.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定