Install Spotify
Below are various ways you can install a client to install Spotify music. This is order of my preference.
From Deb Pakage
Run the following to install Spotify.
Ubuntu 22.04 And Newer
KEY_URL="https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg" \
&& curl -fsSL $KEY_URL | sudo gpg --dearmor -o /usr/share/keyrings/spotify.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/spotify.gpg] http://repository.spotify.com stable non-free" \
| sudo tee /etc/apt/sources.list.d/sublime-text.list \
&& sudo apt update \
&& sudo apt install spotify-client -y
Ubuntu 20.04 And Older
KEY_URL="https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg" \
&& curl -sS $KEY_URL | sudo apt-key add - \
&& echo "deb http://repository.spotify.com stable non-free" \
| sudo tee /etc/apt/sources.list.d/spotify.list \
&& sudo apt update \
&& sudo apt install spotify-client -y
Possible Issues (Intel Graphics)
When I installed Spotify this way, the player would not let me play music, and tell me to disable "offline mode", which it wasn't in. Also, when I launched Spotify from the CLI, I would get this error message on startup.
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
In the end, I was unable to fix this issue, and ended up using the Nuvola solution. However, after physically installing an Nvidia graphics card, and installing the nvidia drivers, this problem "went away".
Nuvola (Flatpak)
Nuvola is a lightweight desktop application for streaming web-based media, which includes Spotify. Unfortunately it is not in active development anymore, but I found that it works and does the job, and unlike other third-party solutions such as Clementine, Spot, and ncspot, it works even if you don't have a Spotify premium account.
Run the following command to install the Spotify Nuvoloa application. This will add the relevant repositories before then installing the flatpak.
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo \
&& flatpak remote-add --if-not-exists nuvola https://dl.tiliado.eu/flatpak/nuvola.flatpakrepo \
&& sudo flatpak update \
&& flatpak install nuvola eu.tiliado.NuvolaAppSpotify
This client "just works" and unlike the official spotify snap package, if you re-launch it from your launcher, it will re-open your existing instance, rather than launching a new one that won't work.
Snap Package
This is the easiest way to install Spotify. However, it is annoying that if you launch spotify again from your launcher, it will bring up a new instance that won't work, instead of re-opening your existing instance. I also just hate snaps, and find them slow and buggy.
snap install spotify
References
- Addictive Tips - How To Listen To Spotify Without The Official Client On Linux
- Ask Ubuntu - Error while running Spotify, libva error; init failed [closed]
- Ask Ubuntu - Chrome libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
First published: 30th July 2022