Tuesday 8 May 2012

Spotify on CentOS 6

There is no installation for Spotify on CentOS, and there are some whacked dependencies which are cumbersome to get around. I tried this on CentOS 6.2

First install Alien (and git):

yum install git make
git clone git://git.kitenet.net/alien
cd alien/
perl Makefile.PL; make; make install

Now download spotify .deb files from:

http://repository.spotify.com/pool/non-free/s/spotify/


Convert and install the Debian/Ubuntu packages:

alien --to-rpm spotify-client-qt*.deb
rpm -Uvh --nodeps spotify-client-qt*.rpm
alien --to-rpm spotify-client*.deb
rpm -Uvh --nodeps spotify-client*.rpm

You're almost done! Now download my magical package of required libraries:
http://dl.dropbox.com/u/17435887/CentOS6/andersx/spotify_libs.tar.gz

Extract these in your home folder. It'll create a directory and a file named (in my case):

/home/andersx/spotify_libs
/home/andersx/spotify.sh

Edit the .sh file so it points to your home directory. In my case:
export LD_LIBRARY_PATH=/home/andersx/spotify_libs

The libraries in spotify_libs were carefully taken from a Ubuntu 10.04 LTS, and in order to NOT mess up your CentOS, use the supplied script to start Spotify without exporting it to your $LD_LIBRARY_PATH when you don't need it.

Of course feel free to put the libraries and launcher script somewhere else.

Happy listening!
:wq

20 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks for the post - just what I was looking for.

    Helped me install spotify on my CentOS laptop :)

    ReplyDelete
  3. Thanks for the comments!

    I actually put an executable file named "spot" in /usr/bin/ so I can just type "spot" and start spotify that way. The file contains something like:

    #!/bin/bash
    export LD_LIBRARY_PATH=/opt/spotify_libs:$LD_LIBRARY_PATH
    /usr/bin/spotify

    cheers!

    ReplyDelete
  4. Cool - thanks! This got me running spotify in no time!

    For anyone else who has problems here are a couple more pointers:
    - I couldn't get git to work for alien so downloaded the latest snapshot directly from the alien web page herer http://git.kitenet.net/
    - I initially downloaded all of the deb files from spotify, but then realised that I only needed the amd64 (ie 64 bit version) of the main client. Running your instructions with both downloaded caused a rpm error.

    Thanks again!

    ReplyDelete
  5. it appears the libraries provided in the dropbox link are 64-bit only. any way of getting the 32-bit equivalents?

    ReplyDelete
  6. When I follow your instructions (which worked fine) and then run spotify.sh, I get an error complaining that libssl.so.1.0.0 could not be found. Since the libssl.so file in your spotify_libs directory is 0.9.8, I wonder if this is all out of date. Is there any chance that updated dlls can be put together? Where would I find them?

    ReplyDelete
  7. Hi harvey.

    Ah, yes, the libssl is definitely out of date! The problem here is, that Ubuntu 10.04 (from where I got the libs) does not have 1.0.0.

    Your best bet is probably to get the libssl1.0.0 from somewhere else.

    if you are lucky, you can just do a "yum install libssl" or something like this. That would be the prettiest way to do things (using CentOS own package manager).

    If this fails you could try this, but as I don't use CentOS anylonger, I cannot test this for you. But likely you can find and download the correct one form this page but this will be Ubuntu 12.04 packages which definitely should work:

    http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.1-4ubuntu5.17_amd64.deb

    And then extract the libssl file from the deb package.

    Hope you get it working. :)

    ReplyDelete
  8. I put the equivalent from 14.04 in my dropbox, maybe try and download this first?

    https://dl.dropboxusercontent.com/u/17435887/CentOS6/andersx/spotify_libs/libssl.so.1.0.0

    ReplyDelete
  9. It seems to have liked that. I don't suppose you could give me libcrypto.so.1.0.0 as well? Is there an easy source for Ubuntu files where I can get these files?

    ReplyDelete
  10. I am not aware of any such place unfortunately, other than extracting from .deb files.

    I put the libcrypto in the dropbox as well:
    https://dl.dropboxusercontent.com/u/17435887/CentOS6/andersx/spotify_libs/libcrypto.so.1.0.0

    ReplyDelete
  11. For the record, this is how I got the Linux Spotify client version 0.9.4 (i386) running on CentOS 6.6 (x86_64): https://www.dropbox.com/sh/3d142gvrsjchshq/AAD7KWJHAJ_gv00nX-cA2X4ta?dl=0

    ReplyDelete
    Replies
    1. Thanks for sharing! Will certainly be to good use for someone!

      Delete
  12. Hello all,

    I have done all the steps , I run spotify.sh
    and get error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory

    When I try to get the library from yum I get a 404 error.
    I am running CentOS 6.3.

    Any suggestions?

    Thanks

    ReplyDelete
    Replies
    1. Hi! Could you post the output of ldd? E.g. run

      $ ldd /usr/bin/spotify

      or wherever your binary is located.

      Delete
  13. Hi Anders,
    So the output is

    linux-gate.so.1 => (0x00a4b000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00a1a000)
    librt.so.1 => /lib/librt.so.1 (0x00fde000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00325000)
    libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00639000)
    libgthread-2.0.so.0 => /lib/libgthread-2.0.so.0 (0x00e8b000)
    libQtGui.so.4 => not found
    libQtCore.so.4 => not found
    libQtDBus.so.4 => not found
    libQtNetwork.so.4 => not found
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x008b4000)
    libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x037a1000)
    libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x0023b000)
    libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00d13000)
    libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00ac6000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00bdf000)
    libgio-2.0.so.0 => /lib/libgio-2.0.so.0 (0x00110000)
    libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00cd6000)
    libgobject-2.0.so.0 => /lib/libgobject-2.0.so.0 (0x005ed000)
    libcef.so => not found
    libm.so.6 => /lib/libm.so.6 (0x00724000)
    libasound.so.2 => not found
    libXss.so.1 => not found
    libdl.so.2 => /lib/libdl.so.2 (0x005e6000)
    libssl.so.0.9.8 => not found
    libcrypto.so.0.9.8 => not found
    libresolv.so.2 => /lib/libresolv.so.2 (0x0094e000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00c2c000)
    libc.so.6 => /lib/libc.so.6 (0x00452000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x0074e000)
    /lib/ld-linux.so.2 (0x00430000)
    libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00dc3000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00dd6000)
    libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00a9a000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00b46000)
    libgmodule-2.0.so.0 => /lib/libgmodule-2.0.so.0 (0x00633000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00dab000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00cf7000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00dd1000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x00d02000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00da1000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00d95000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00c4d000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00dbe000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00c55000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x001c1000)
    libz.so.1 => /lib/libz.so.1 (0x00cc0000)
    libselinux.so.1 => /lib/libselinux.so.1 (0x00a53000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00c00000)
    libexpat.so.1 => /lib/libexpat.so.1 (0x0088a000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00a95000)

    ReplyDelete
  14. Try and export the variables in the script from my tar-ball, and then you need to figure out, which packages supply the missing libraries. See this stackoverflow:

    http://stackoverflow.com/questions/1133495/how-do-i-find-which-rpm-package-supplies-a-file-im-looking-for

    That is unfortunately the best advice I can give you, since I don't use CentOS at the moment! Good luck!

    ReplyDelete
  15. FWIW, on my CentOS 6.6:
    1009:taltta:/> sed -e 's_ /o_ldd /o_g' < /opt/spotify/bin/spotify.sh | sh | grep Qt
    libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x06bcb000)
    libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x076d1000)
    libQtDBus.so.4 => /usr/lib/libQtDBus.so.4 (0x06b56000)
    libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x06a59000)
    libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x00101000)
    1010:taltta:/> yum whatprovides libQtGui.so.4
    Loaded plugins: fastestmirror, refresh-packagekit
    Loading mirror speeds from cached hostfile
    * base: mirror.nsc.liu.se
    * epel: mirror.awanti.com
    * extras: mirror.nsc.liu.se
    * rpmforge: mirror.awanti.com
    * updates: mirror.nsc.liu.se
    1:qt-x11-4.6.2-28.el6_5.i686 : Qt GUI-related libraries
    Repo : base
    Matched from:
    Other : libQtGui.so.4



    1:qt-x11-4.6.2-28.el6_5.i686 : Qt GUI-related libraries
    Repo : installed
    Matched from:
    Other : Provides-match: libQtGui.so.4



    1011:taltta:/>
    1011:taltta:/> yum whatprovides libasound.so.2
    Loaded plugins: fastestmirror, refresh-packagekit
    Loading mirror speeds from cached hostfile
    * base: mirror.nsc.liu.se
    * epel: mirror.awanti.com
    * extras: mirror.nsc.liu.se
    * rpmforge: mirror.awanti.com
    * updates: mirror.nsc.liu.se
    alsa-lib-1.0.22-3.el6.i686 : The Advanced Linux Sound Architecture (ALSA)
    : library
    Repo : base
    Matched from:
    Other : libasound.so.2



    alsa-lib-1.0.22-3.el6.i686 : The Advanced Linux Sound Architecture (ALSA)
    : library
    Repo : installed
    Matched from:
    Other : Provides-match: libasound.so.2



    1012:taltta:/>

    Similar queries for other missing libs of yours:
    libasound.so.2 => provided by alsa-lib-1.0.22-3.el6.i686
    libXss.so.1 => provided by libXScrnSaver-1.2.2-2.el6.i686

    libcef.so seems to be found under the spotify-client directory.

    ReplyDelete
  16. Hello anders

    This link is not available
    http://dl.dropbox.com/u/17435887/CentOS6/andersx/spotify_libs.tar.gz
    Can u help me?
    Thanks

    ReplyDelete
  17. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!! spotifyplaylist

    ReplyDelete