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 the Spotify application with Linux Mint 20 using three different methods.
- Recommended OS: Linux Mint 20 or higher.
- User account: A user account with sudo or root access.
Update Operating System
Update your Linux Mint operating system to make sure all existing packages are up to date:
sudo apt update && sudo apt upgrade -y
The tutorial will be using the sudo command and assuming you have sudo status.
To verify sudo status on your account:
Example output showing sudo status:
[joshua@linuxmint ~]$ sudo whoami root
To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Linux Mint.
To use the root account, use the following command with the root password to log in.
The tutorial will be utilizing the terminal, and for those unfamiliar, this can be found in your show applications menu.
Option 1 – Install Spotify with APT
The first installation option is to import the repository from Spotify and install it using the APT package manager. 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 -y
Secondly, to import the repository in your terminal, use the following command.
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
The above command will automatically add the Spotify repository to your APT directory with its unique listing.
Next, use the following command to import the GPG key to allow the system to trust the packages being added from the repository.
curl -sS https://download.spotify.com/debian/pubkey_0D811D58.gpg | sudo apt-key add -
Next, update your system to reflect the new addition.
sudo apt update
With the repository sorted, proceed to install Spotify using the following.
sudo apt install spotify-client
Verify the installation by using the –version command.
Spotify updates are handled using the standard apt update & upgrade command.
sudo apt update sudo apt upgrade
If you no longer wish to have Spotify installed with the APT method, use the following command to remove the package.
sudo apt autoremove spotify-client --purge
This will automatically remove any unused dependencies that were installed originally with Spotify.
Additionally, remove the repository source listing with the following command.
sudo rm /etc/apt/sources.list.d/spotify.list
Option 2 – Install Spotify with Flatpak
The second option is to use the Flatpak package manager. Flatpak should be present on your Linux Mint system by default.
First, if you have removed Flatpak or are unsure if you have, run the install command as follows.
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
Now install Spotify using the following flatpak command.
flatpak install flathub com.spotify.Client
Type Y twice, then press the ENTER KEY twice to install.
Flatpak should auto-update packages roughly 10 minutes into a new desktop session by default. However, if you need to update manually, use the following command.
To remove the Flatpack version of Spotify, run the following command:
flatpak uninstall --delete-data com.spotify.Client
Type Y and then ENTER KEY to proceed with the removal of Spotify using the Flatpak method.
Note, you will be prompted twice to Type Y or N. The second option removes all data for complete removal.
Option 3 – Install Spotify with Snapcraft
The third option is to use the Snap package manager. Snap is not installed on Linux Mint, and the developers of Linux Mint frown upon Snap a bit which is unusual given they are using the downstream Ubuntu versions and have done some locking you need to sort out first.
To install Snap, first, use the following command.
sudo mv /etc/apt/preferences.d/nosnap.pref ~/Documents/nosnap.backup
The above commands removed the lock put in place by Linux Mint.
To install Snap, use the following command:
sudo apt install snapd -y
When you have returned to your system, start the snapd service and enable automatic startup.
sudo systemctl enable snapd --now
Before you continue any further, it is recommended to reboot your PC to make sure all paths for Snap have been generated. Failure to do this may result in errors using Snap. If you encounter these, make sure to go back and follow this step.
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
Next, verify the Snapd service is running by using the systemctl command:
systemctl status snapd
If you are installing Snap for the first time, it is advised to install the core files to avoid conflicting issues:
sudo snap install core
core 16-2.52.1 from Canonical✓ installed
Next, install the Spotify package using snap:
sudo snap install spotify
spotify 188.8.131.529.gc253025e from Spotify✓ installed
As above, this informs you that Spotify was successfully installed and the version number.
Snap packages are more significant in size than traditional repositories through the APT package manager for several reasons. However, the trade-off is more straightforward maintained packages that are often updated to the latest available version.
For the future, to update along with and any other packages installed by Snap, run the following command:
sudo snap refresh
If you no longer need Spotify installed, remove it using the Snap remove command.
sudo snap remove spotify
How to Launch Spotify
Now that you have the Spotify client installed, launching can be done in two ways.
In your terminal type:
If you would like to launch Spotify and use the terminal, send it to the background:
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 to open with the path: Taskbar > Sounds & Video > Spotify.
Once you open Spotify, you will see the first default landing screen. From here, you can sign or create an account.
Congratulations, you have successfully installed and launched Spotify.
Comments and Conclusion
In the tutorial, you have learned how to install Spotify on your Linux Mint 20 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.
Overall, it is worth installing the Spotify desktop player as it’s far superior to the web player in both operating and looks, along with not accidentally closing your browser and losing Spotify.