Updating OSX Lion 10.7.5 to 10.8.4 so I can install xcode
You need to buy Mountain Lion or Mavericks in the AppStore. That will take care of the installation.  Mavericks is free, is supposed to be better, but there are some problems associated with it.  

Before doing that, in any case, check your most frequently used applications to see if they are compatible with the OS X version you intent to install.  Then do a full backup and do disk permission checks in DiskUtilities before you upgrade.