Spotify is a digital music streaming service with both free and paid features. It is the world’s largest music streaming service provider, with over 381 million monthly active users, including 172 million paying subscribers, as of September 2021. Spotify can give you instant access to a vast online library of music and podcasts, which is very popular as you can listen to the content of your choice whenever you feel like it.
In the following tutorial, you will learn how to install Spotify on Ubuntu 22.04 LTS Jammy Jellyfish using the official Spotify repository or alternative snap and flatpak installation managers.
Table of Contents
Before going into the tutorial, the first step is to run an apt update, which ensures your system is up-to-date to avoid any conflicts.
sudo apt update && sudo apt upgrade -y
Install Spotify – APT Method
The first installation option is to import the repository from Spotify and install it using the APT package manager by importing the official Spotify repository. This would be ideal for most users, especially when keeping the package up to date.
First, install the following dependencies needed to install Spotify using the APT method.
sudo apt install curl libcanberra-gtk-module software-properties-common apt-transport-https gnupg2 ubuntu-keyring -y
Next, import the GPG key with the following command.
wget -O- https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/spotify.gpg
With the GPG key imported, now add the official repository as follows.
echo "deb [signed-by=/usr/share/keyrings/spotify.gpg] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
Next, update your system to reflect the new repository that was imported.
sudo apt update
With the repository sorted, proceed to install Spotify using the following.
sudo apt install spotify-client -y
Install Spotify – Flatpak Method
The second option is to use the Flatpak package manager, which is not installed on Ubuntu distributions, given Snap, which is Flatpak’s rival, is owned by Canonical and Ubuntu. However, Flatpak is still available to install from Ubuntu’s default repository.
First, install the Flatpak manager; this can be skipped if you already have it installed.
sudo apt install flatpak -y
Next, you need to enable Flatpack using the following command in your terminal:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
For users installing Flatpak for the first time, it is often recommended to reboot your system. Failure to do this can occur with odd issues arising, such as paths not being generated for icons.
SKIP THE REBOOT IF FLATPAK IS INSTALLED.
Now install Spotify using the following flatpak command.
flatpak install flathub com.spotify.Client -y
Install Spotify – Snap Method
The third method will be installing Spotify with snap. The Snapcraft package manager should be installed on Ubuntu-installed systems unless removed previously.
Currently, all three methods are up-to-date and are separated by a matter of a day or so when it comes to updates, so it is a choice of which package manager you prefer to use.
First, re-install Snapd if you have removed it previously.
sudo snap install snapd -y
Ideally, it is worth rebooting when installing third-party managers; if you experience issues, please do this.
Next, install the snap core to avoid any conflicts.
sudo snap install core
Next, some packages come in classic, so you need to create a symlink to enable classic snap support.
sudo ln -s /var/lib/snapd/snap /snap
Now install the snap package with the following command.
sudo snap install spotify
How to Launch Spotify
Now that you have the Spotify client installed, launching can be done in two ways.
In your terminal type:
Alternatively, Flatpak users will need to launch using the command below from a terminal instance:
flatpak run com.spotify.Client
However, this isn’t practical, and you would use the following path on your desktop.
Activities > Show Applications > Spotify.
Once you open Spotify, you will see the first default landing screen. From here, you can sign or create an account and arrive at the streaming application.
Congratulations, you have successfully installed and launched Spotify.
How to Update/Upgrade Spotify
Depending on the method of installation used, the following commands can be used to update.
APT Update Method
sudo apt upgrade && sudo apt upgrade
Flatpak Update Method
Snap Update Method
sudo snap update
How to Remove (Uninstall) Spotify
Use one of the following commands to suit the original installation method for users who no longer require the application.
APT Remove Method
sudo apt autoremove spotify-client -y
Next, remove the repository if you will no longer re-install the streaming application.
sudo rm /etc/apt/sources.list.d/spotify.list
Lastly, remove the GPG key.
sudo rm /usr/share/keyrings/spotify.gpg
Flatpak Remove Method
flatpak uninstall --delete-data flathub com.spotify.Client -y
Next, run the following command for any leftover clean-up.
flatpak remove --unused
Snap Remove Method
sudo snap remove spotify
Comments and Conclusion
In the tutorial, you have learned how to install Spotify on Ubuntu 22.04 LTS desktop using three different methods, which you can change in the future if you prefer using one package manager over another. The most recommended way is to install the Spotify repository with APT, but the other two solid options.
If you are looking for the best experience when listening to Spotify, installing the client is highly recommended. This application has better performance and looks and will keep your browser open, so there is no need to constantly close it out or lose track of where you left off on whatever song!