Installation fail - Mac OS X 10.5.8

60 views
Skip to first unread message

Mohd Murtadha Mohamad

unread,
Nov 12, 2009, 2:32:54 AM11/12/09
to golang-nuts
Hi
I got this problem

tango-ta:/ macbook$ sudo apt-get install bison gcc libc6-dev ed
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package gcc

however I already have gcc here
tango-ta:/ macbook$ gcc
i686-apple-darwin9-gcc-4.0.1: no input files

can i get some help for this

Ta

Mohd Murtadha Mohamad

unread,
Nov 12, 2009, 3:42:48 AM11/12/09
to golang-nuts
Ok thats already fixed, i followed the next step

tango-ta:etc macbook$ sudo easy_install mercurial
Password:
Searching for mercurial
Best match: mercurial 1.3.1
mercurial 1.3.1 is already the active version in easy-install.pth

Using /Library/Python/2.5/site-packages
Processing dependencies for mercurial
Finished processing dependencies for mercurial

So i guess thats fine too, then the next step for fetch is


tango-ta:etc macbook$ hg clone -r release https://go.googlecode.com/hg/
$GOROOT
Traceback (most recent call last):
File "/usr/local/bin/hg", line 27, in <module>
mercurial.dispatch.run()
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line
16, in run
sys.exit(dispatch(sys.argv[1:]))
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line
27, in dispatch
return _runcatch(u, args)
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line
144, in _runcatch
ui.warn(_("** unknown exception encountered, details follow\n"))
File "/Library/Python/2.5/site-packages/mercurial/i18n.py", line 43,
in gettext
return u.encode(encoding.encoding, "replace")
File "/Library/Python/2.5/site-packages/mercurial/demandimport.py",
line 75, in __getattribute__
self._load()
File "/Library/Python/2.5/site-packages/mercurial/demandimport.py",
line 47, in _load
mod = _origimport(head, globals, locals)
File "/Library/Python/2.5/site-packages/mercurial/encoding.py", line
20, in <module>
encoding = locale.getlocale()[1]
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 460, in getlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 373, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

This could be error occured. May be it is something to do with .bashrc
which i haven't touch anything yet. So how can this be helped.

Regards
Ta

M. Shuaib Khan

unread,
Nov 12, 2009, 3:45:00 AM11/12/09
to Mohd Murtadha Mohamad, golang-nuts

Add

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

to your .bashrc
 
This could be error occured. May be it is something to do with .bashrc
which i haven't touch anything yet. So how can this be helped.

Regards
Ta



--
M. Shuaib Khan
http://mshuaibkhan.blogspot.com

wongobongo

unread,
Nov 12, 2009, 3:47:32 AM11/12/09
to golang-nuts
Hey, I just wrote up my Go installation experience as a blog post. I
wrote it up as a walkthrough.

http://www.kelvinwong.ca/2009/11/12/installing-google-go-on-mac-os-x-leopard/

My Mac OS X version is also 10.5.8. Let me know if it helps.

I believe that 'apt-get' stuff is for Debian. I've never used that on
my Mac before.

K

philcolbourn

unread,
Nov 14, 2009, 5:16:52 AM11/14/09
to golang-nuts
I also followed Kelvin's post but I used ~/.profile instead.

http://philatwarrimoo.blogspot.com/2009/11/google-go-on-mac-os-x.html

apt-get can be used on OS-X if fink is installed.

http://www.finkproject.org/

On Nov 12, 7:47 pm, wongobongo <wongo...@gmail.com> wrote:
> Hey, I just wrote up my Go installation experience as a blog post. I
> wrote it up as a walkthrough.
>
> http://www.kelvinwong.ca/2009/11/12/installing-google-go-on-mac-os-x-...
>
> My MacOS Xversion is also 10.5.8. Let me know if it helps.
>
> I believe that 'apt-get' stuff is for Debian. I've never used that on
> my Mac before.
>
> K
>
> On Nov 11, 11:32 pm, Mohd Murtadha Mohamad <tango...@gmail.com> wrote:
>
> > Hi
> > I got this problem
>
> > tango-ta:/ macbook$  sudo apt-getinstallbison gcc libc6-dev ed

Christoffer Hallas Pedersen

unread,
Nov 14, 2009, 7:27:19 AM11/14/09
to philcolbourn, golang-nuts
Don't know if this is relevant, but I believe the .profile / .bashrc
files are "active" when you are inside of bash. In Mac OS X, Terminal is
one shell, Bash is another. Besides, I can garantee that .bashrc works.
Put it in $HOME.

wongobongo

unread,
Nov 14, 2009, 6:14:22 PM11/14/09
to golang-nuts
I can never get keep .bashrc or .bash_profile or .profile or ??? init
files straight. As a result, I usually just put everything into
my .bash_profile and it just works (so far anyway). The Google
installation instructions recommends that you put the environment
variables into the .bashrc.

I didn't know that they got apt-get running in Fink. Too funny.

K

philcolbourn

unread,
Nov 14, 2009, 6:19:53 PM11/14/09
to golang-nuts
My Terminal.app uses bash as per the Preferences.

ps -A also shows that bash is running.

From the bash man page:

"
When bash is invoked as an interactive login shell, or as a non-
interactive shell with the --login option,
it first reads and executes commands from the file /etc/
profile, if that file exists.
After reading that file, it looks for ~/.bash_profile,
~/.bash_login, and ~/.profile, in that order, and reads
and executes commands from the first one that exists and is
readable.
"

I use fink so I have a ~/.profile file that possibly prevents bash
reading the ~/.bashrc file.

If you have ~/.bash_profile, use it.
else
if you have ~/.bash_login, use it.
else
if you have ~/.profile, use it.
else
use ~/.bashrc (I have not tested this one, but Christoffer say
it works)

If you have multiple ones, then other files may not be read.

On Nov 14, 11:27 pm, Christoffer Hallas Pedersen

philcolbourn

unread,
Nov 14, 2009, 8:40:53 PM11/14/09
to golang-nuts
Correction:

My Terminal.app uses /usr/bin/login which presumably looks up the
directory service to determine what shell you want to run.

This used to be stored in /etc/passwd.

To check your shell I think you do this:

dscl . -read /Users/username UserShell

Mine says /bin/bash
> > >> My MacOS Xversion is also10.5.8. Let me know if it helps.

Christoffer Hallas Pedersen

unread,
Nov 14, 2009, 9:04:58 PM11/14/09
to philcolbourn, golang-nuts
This is what you do.

Use spotlight or dock to open Terminal.app. Type gedit (or mate if you
have TextMate) .bashrc. Put in the following lines (from the golang.org
installation guide):

export GOROOT=$HOME/go
export GOOS=darwin
export GOARCH=386
export GOBIN=$HOME/bin

export PATH=/opt/local/bin:/opt/local/sbin:$HOME/bin:$PATH

This is ofc if you have installed go into your active users folder.

The last line updates your path so you can access stuff like gcc.

Now save the file and type "bash" in your Terminal. Test your
configuration now by typing "env | grep '^GO'" which is a regular
expression that lists every variable that starts with go (GOROOT, GOOS,
GOARCH, GOBIN).

The effect of typing bash is not only opening the bash shell, but also
reloading the .bashrc file. So if you change your .bashrc file while in
bash, type "bash" again to reload.

Now you should be able to run the make all file.

Good luck.

C.

philcolbourn

unread,
Nov 14, 2009, 11:18:42 PM11/14/09
to golang-nuts
So you always type 'bash' after you open a Terminal to get the GO
environment variables set? Or does ~/.bashrc work for you when you
launch Terminal?

As I tried to explain, it may not work for everyone that expects their
GO environment to be set from ~/.bashrc when they launch Terminal.

And running bash in bash is a bit messy, and if after you change
~/.bashrc you seem to open another bash shell so you have bash in bash
in bash.



On Nov 15, 1:04 pm, Christoffer Hallas Pedersen

Ashok Gautham

unread,
Nov 14, 2009, 11:26:56 PM11/14/09
to philcolbourn, golang-nuts
On Sun, Nov 15, 2009 at 9:48 AM, philcolbourn <philco...@gmail.com> wrote:
> So you always type 'bash' after you open a Terminal to get the GO
> environment variables set? Or does ~/.bashrc work for you when you
> launch Terminal?
~/.bashrc runs everytime bash runs. If your default shell is bash, Terminal
starts a new bash process when you open it. So ~/.bashrc will run

If you find it a problem to set up .bashrc for every user separately,
put it in /etc/profiles.d/go.sh
Every file in /etc/profiles.d will be run for every user/

> As I tried to explain, it may not work for everyone that expects their
> GO environment to be set from ~/.bashrc when they launch Terminal.

I use Zsh and I have it in .zshrc. The only place I used bash was when
building go.

> And running bash in bash is a bit messy, and if after you change
> ~/.bashrc you seem to open another bash shell so you have bash in bash
> in bash.
You dont have to.
source ~/.bashrc

---
Ashok `ScriptDevil` Gautham

philcolbourn

unread,
Nov 15, 2009, 12:58:59 AM11/15/09
to golang-nuts
I don't think that is always right.

The bash man page says this:

"When an interactive shell that is not a login shell is started,
bash reads and executes commands from ~/.bashrc, if that file exists.
"
Terminal starts bash as a login shell it seems (put an echo "bashrc"
in ~/.bashrc and see for yourself).

Good point about source though.

On Nov 15, 3:26 pm, Ashok Gautham <scriptdevil...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages