Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Unable to download debian packages

Unable to download debian packages

 

Plan

Premium

 

Country

USA

 

Device

PC - Ryzen 5950x

Operating System

Ubuntu 22.04

 

My Question or Issue

 

  Error reading from server. Remote end closed connection [IP: 108.138.101.34 80]
E: Failed to fetch http://repository.spotify.com/pool/non-free/s/spotify-client/spotify-client_1.2.26.1187.g36b715a1_amd64.deb  Error reading from server. Remote end closed connection [IP: 108.138.101.34 80]

 

 When I try to follow the debian package instructions, it seems like the repository is downloading very slowly (50 kb/s) and then eventually disconnecting me. I have 1gbs fiber and I only have issues with this repository. It seems like it's overloaded or not supported very well.

 

I prefer to install using debian packages as the snap store tends to have bugs and contaminates my system with strange configurations that are hard to debug.

Reply
3 Replies

Hey @bkite 

 

I've had the same issue with that particular server. The only method that helped me get the .deb downloaded is opening the repository site in browser and attempting to download the newest version from there 'by hand'. It won't be that slow, but will cut connection every few seconds, so in the end you have to retry quite a few times before you get the file downloaded. How good the integrity is is a different topic, as there's no way to check.

I haven't had issues with Spotify installed from such a .deb, but it also never updated past its initial downloaded version. : ) Likely just because the connection doesn't last. So you have to take care of updating the client too.
Upside is.. it's fast!

Hope it helps, have a lovely day! I wish the site worked better since .deb packages are generally pretty fault-proof compared to snap and are far better to handle.

I tried downloading in browser (firefox), but it kept failing.  I had to use the CLI to download the .deb manually and use dpkg to install it - wget https://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_1.2.37.701.ge66e...

 

Still failed during download 3 times due to write errors

You can use something like the script below to download/auto-resume the DEB file directly from the Spotify repo. Script can download from stable or testing channel and will verify the checksum when complete. You can then manually install the DEB with dpkg or with whatever methods you normally handle DEBs. 

save as file, chmod +x, run.
Example: ./deb_download.sh or ./deb_download.sh -testing

#!/usr/bin/env bash

BASE_URL="http://repository.spotify.com/"

# Package info URL | Use "-testing" for testing channel, else stable
if [ "$1" == "-testing" ]; then
channel_name="testing"
PACKAGES_URL="${BASE_URL}dists/testing/non-free/binary-amd64/Packages"
shift
else
channel_name="stable"
PACKAGES_URL="${BASE_URL}dists/stable/non-free/binary-amd64/Packages"
shift
fi

# Fetch file info
file_info=$(curl -s $PACKAGES_URL | awk '/Package: spotify-client/,/^$/{print; if (/SHA256/) exit}')

# Extract filename and hash from file info
filename=$(echo "${file_info}" | grep Filename | awk '{print $2}')
sha256sum_expected=$(echo "${file_info}" | grep SHA256 | awk '{print $2}')

# DEB file URL
DEB_URL="${BASE_URL}${filename}"

# Temporary filename
temp_file=$(basename "${filename}")

# Function to calculate SHA256 of downloaded file
calculate_sha256() {
sha256sum "${temp_file}" | awk '{print $1}'
}

# Function to download file with resume capability
download_file() {
echo -e "Downloading ${temp_file} from ${channel_name} channel...\n"
curl -C - -o "${temp_file}" "${DEB_URL}"
}

# Download file and verify hash
while true; do
download_file
if [ -f "${temp_file}" ]; then
sha256sum_actual=$(calculate_sha256)
if [ "${sha256sum_actual}" == "${sha256sum_expected}" ]; then
echo -e "\nFile downloaded and verified successfully."
break
else
echo -e "\nHash mismatch. Redownloading..."
rm -f "${temp_file}"
fi
else
echo -e "\nDownload failed. Retrying..."
fi
done

 

Suggested posts