Sunday, 15 January 2012

Spotify Adventures in the Land of Ubuntu

Warning: the following post gets pretty technical.

I have been known to rave on how good Spotify is; by the same token, I have been known to rave on how good Linux is, and in particular its incarnation that I tend to use the most - Ubuntu. This post is written to share some insights on using a free Spotify account in Ubuntu land, and it's written because:
  1. Generally speaking, Spotify does not support Linux.
  2. While Spotify does offer an experimental Linux version, that version is only accessible to paying Spotify users because thus far Spotify has been unable to integrate ads into the software.
Given the above,  I have been running it on my Ubuntu machines using Wine (a Linux emulator for Windows). Spotify itself has a pretty good page on running its software in Ubuntu using Wine (see here); follow that and you'd be home free.
That is... until you install the latest version of Spotify's Windows client, or - as has happened to me - until Spotify upgrades itself automatically to the latest version (currently version 8) without asking for your approval. Once that has happened, Spotify kept on crashing on all my Ubuntu machines. Given how important Spotify is to me I had to fix the problem, and indeed I did so after some Googling and playing around. The rest of this post is here to tell you what I did to get Spotify up and running again in Ubuntu land.

First, a summary for those who know their way around Linux:
  1. I removed my existing installation of Wine and all the Windows software installed under it.
  2. I installed the latest version of Wine (not through Ubuntu's repositories).
  3. I installed winhttp using Winetricks.
And now for the more elaborate description of the steps I took (note you may start from step 5 if you already have the latest version of Wine installed):
  1. Uninstall all of Wine's Windows applications (I have found that using Wine's own uninstaller to remove Spotify alone did not really remove it):
         cd $HOME
      rm -rf .wine
  2. Uninstall Wine through the Ubuntu Software Center.
  3. To remove the last traces of Wine that may still be there, do the following (note the following will still leave menu items and other stuff behind; those do not matter much as far as making Spotify work is concerned):
         sudo apt-get remove wine
  4. Install the latest version of Wine, 1.3.3:
      sudo apt-add-repository ppa:ubuntu-wine/ppa
      sudo apt-get update
      sudo apt-get install wine1.3
  5. Start Winetricks, a Linux application which has been installed as part of the new Wine installation. 
  6. Make the following selections in Winetricks' menus:
    a. Select the default wine prefix
    b. Install a Windows DLL or component
    c. Choose to install winhttp (out of the long list of options available).
  7. Download the latest version of Spotify for Windows (here).
  8. Install Spotify into Wine by right-clicking the Spotify installation file you've just downloaded and choosing to open it using Wine.
  9. You may need to set wine up for Spotify again in order to have proper sound (as described here under Wine configuration).
That's it. Now all you have to do is sit back and enjoy the music!


Image: Spotify

No comments: