Ubuntu 16.04 and later
Spotfy is a snap package in Ubuntu 16.04 and later. To install Spotify open the terminal and type;
sudo apt install snapd
sudo snap install spotify
Open the Ubuntu Software Center and from the Ubuntu Software Center menu select Edit -> Software Sources. Or if you are using Ubuntu 13.04 or Ubuntu 13.10, search the Dash for software and click the Software & Updates icon.
To install spotify-client, the Debian/Ubuntu client for Spotify, open the terminal and follow the following steps:
Edit the sources.list file by adding the Spotify repository to it:
sudo nano '/etc/apt/sources.list'
Add this line to sources.list:
deb http://repository.spotify.com stable non-free
Press the keyboard combination Ctrl+O and after that press Enter to save the sources.list file. Press the keyboard combination Ctrl+X to exit nano.
Run the following command to add the Spotify public key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
Tell your system to pull down the latest list of software from each archive it knows about, including the Spotify repository you just added:
sudo apt-get update
sudo apt-get install spotify-client