Spotify is a digital music streaming service with both free and paid features. As of September 2022, it is the world’s largest music streaming service provider, with over 443 million monthly active users, including 187 million paying subscribers. Spotify can give instant access to a vast online library of music and podcasts and has been very popular as you can listen to the content of your choice whenever you feel like it. You can also create your playlists or listen to those created by Spotify. In addition, Spotify offers several features for its premium users, such as ad-free listening, high-quality audio, offline mode, and more. Spotify is available on various devices, including smartphones, tablets, computers, and more.
The following tutorial will teach you how to install Spotify on Linux Mint 21 LTS using the official Spotify repository or alternative flatpak installation manager using the command line terminal.
Table of Contents
Update Linux Mint
Before the tutorial, the first step is to run an apt update, ensuring 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 to install Spotify using the APT method.
sudo apt install curl libcanberra-gtk-module dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https -y
Next, import the GPG key with the following command.
curl -fsSL https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/spotify.gpg > /dev/null
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-get 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 installed on Linux Mint by default.
First, re-install the Flatpak manager; this can be skipped if you have not removed it previously. If unsure, run the command, and you will know if it is or is not 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, 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
How to Launch Spotify
Now that you have the Spotify client installed, launching can be done in a few ways.
The first option is launching directly from your terminal. For users that use the APT method, use the following command.
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.
Taskbar > Sound & Video > 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
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
Comments and Conclusion
Installing the client is highly recommended if you are looking for the best experience when listening to Spotify. 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!