Skip to content

xiaozhangup/SpotifyRPM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Native-Latest-Spotify-on-Fedora-43

How to install the latest native Spotify on Fedora 43 or later

Quick Install (Automated)

An automated script is provided that handles all the steps below in one go:

sudo dnf install -y curl alien rpmrebuild xdg-utils
chmod +x install-spotify.sh
./install-spotify.sh

The script will:

  1. Fetch the available .deb packages from the Spotify repository
  2. Let you choose which version to install
  3. Download, convert to .rpm, rebuild, and install it
  4. Set up the .desktop file and icons
  5. Optionally apply the Wayland window-frame fix

Manual Installation

Preparation

  • curl
  • alien
  • rpmrebuild

Step 1

Download a Spotify .deb package directly from the repository:

Browse https://repository.spotify.com/pool/non-free/s/spotify-client/ and download the desired .deb file, then convert it to .rpm with alien:

sudo dnf install -y curl alien
curl -LO https://repository.spotify.com/pool/non-free/s/spotify-client/<chosen-file>.deb
sudo alien -r ./spotify-client_*.deb

Step 2

Modify the .rpm package:

sudo dnf install rpmrebuild -y
rpmrebuild -pe --notest-install ./spotify-client-xxxx.rpm

Edit the spec file as follows:

  1. Locate the %files section.
  2. Remove all lines that do not contain the text spotify.
  3. Save and exit. Wait for rpmrebuild to finish.
  4. Install the generated .rpm file (usually located in ~/rpmbuild/...).

Step 3

Copy the .desktop file:

cp /usr/share/spotify/spotify.desktop ~/.local/share/applications/

Step 4

Install Spotify icons:

cd /usr/share/spotify/icons

Create a script named install_icons.sh in that directory and run it:

#!/bin/bash

# Check if running as root (write permission needed for icon installation)
if [ "$(id -u)" -ne 0 ]; then
   echo "Error: Please run this script with sudo (e.g., sudo bash install_icons.sh)"
   exit 1
fi

# Check if xdg-icon-resource tool exists
XDG_ICON_RESOURCE="$(command -v xdg-icon-resource 2> /dev/null)"
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
  echo "Error: xdg-icon-resource not found. Cannot install icons." >&2
  exit 1
fi

echo "Scanning for icon files in the current directory..."
count=0

# Iterate over png files matching the naming pattern
for icon in ./spotify-linux-*.png; do
  # If wildcard matches nothing, break
  [ -e "$icon" ] || break

  # Get filename (e.g., spotify-linux-512.png)
  filename=$(basename "$icon")
  
  # Extract size:
  # 1. Remove prefix "spotify-linux-" to get "512.png"
  temp="${filename#spotify-linux-}"
  # 2. Remove suffix ".png" to get "512"
  size="${temp%.png}"

  echo "Installing: $filename -> Registered as spotify-client (Size: ${size}x${size})"
  
  # Call system tool to install icon
  # Parameters:
  # --noupdate: Do not update cache yet, wait until all are installed
  # --size: Specify icon size
  # "spotify-client": The icon name recognized by the system (matches Icon=spotify-client in .desktop file)
  "$XDG_ICON_RESOURCE" install --noupdate --size "$size" "$icon" "spotify-client"
  
  count=$((count+1))
done

if [ $count -eq 0 ]; then
    echo "Warning: No 'spotify-linux-*.png' files found in the current directory."
    echo "Please ensure you are running this script inside the extracted icons folder."
    exit 1
else
    echo "Installed $count icons."
    echo "Refreshing system icon cache..."
    "$XDG_ICON_RESOURCE" forceupdate
    echo "Done!"
fi
chmod +x install_icons.sh
sudo ./install_icons.sh

Step 5 (Only in Wayland)

Fix window frame issues (Wayland only):

nano ~/.local/share/applications/spotify.desktop

Change the Exec= line from spotify %U to spotify --ozone-platform=x11 %U.

Step 6

Log out and log back in. You can now use Spotify like any other application.

About

How to install native latest spotify on fedora 43 or later

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages