Unable to install Xcode on a freshly-installed OS X Lion OK, so I own 2 macs : 


a MacBook Pro (running 10.8 with the latest Xcode on it)
an iMac (running 10.6 on one partition - Xcode installed and all - , and 10.7 - just installed - on another partition)


Note : all of Xcode versions + OSes have been purchased via the App Store



Now, here's my problem :


I'm signing in with my Apple ID
I'm going to My Purchases
Xcode is obviously there, BUT with the "Install" option, not the "Download" option
I'm clicking on "Install", it seems to be working for some time and then it either stops working or it throws an error message along these lines : "Something went wrong. Unknown error code."


I need your help guys. That's why I partitioned my iMac's drive in the first place : to be able to debug under 10.7 as well (see here: Install 2 different OS X versions on the same machine/hdd ).

So, any ideas???



Hint : I've also tried to find any instances of "Install Xcode" installers on my MacBook Pro, hoping that there would be some left (appropriate for 10.7 that is)... but unfortunately all I've found didn't seem to want to work under 10.7. So I'm stuck - I don't think there's any other way I could manage to re-install it, other than through the App Store, and the... App Store doesn't seem to be working... :S
I have a similar setup, but I've got 10.6 on one partition, 10.7 on another and 10.8 on yet another partition.  When the Mac App Store looks for installs, it will look at all the partitions for installed apps.  I think that is your problem: it is already finding Xcode on your 10.6 partition.

Here is how I solved it and how I recommend you to do it as well:

Unmount your 10.6 partition after you boot into your 10.7 partition


If you want to do this automatically, you have to edit the file:

/etc/fstab


Inside of /etc/fstab, you need to place your partition's UDID like so:

UUID=68613ECB-3492-3B8B-9FFF-55FB1F30A32B       none    hfs     ro,noauto


noauto means don't automount it.

To find the UUID of your drive, launch Disk Utility, select the partition and then press the Info toolbar button.  It will show you the UUID listed as Universal Unique Identifier.

Then reboot and you should find that your 10.6 partition is automatically not mounted.

At this point, the Mac App Store should look for Xcode, not be able to find it, and then allow you to install Xcode properly.