spotify-client dpkg post-installation script error code 1

Reply
Highlighted

spotify-client dpkg post-installation script error code 1

Casual Listener

Operating System

Linux pop-os 5.4.0-7634-generic #38~1595345317~20.04~a8480ad-Ubuntu

 

I encountered error as described in title on reinstallation from apt (I removed deb, and wanted to try out flatpack and snap versions of app. Don't bother to do it, apt/deb version integration is by far the best.).

Also I couldn't be sure if it affects reinstalls only or Ubuntu 20.04 installs in general.

As it turns out piece of postinst script fails. I managed to narrow down piece of script that failed:
```

# Add Spotify repository nondestructively
# Let users opt-out of adding a repository with:
# sudo touch /etc/apt/sources.list.d/spotify.list
SOURCE="/etc/apt/sources.list.d/spotify.list"
if [ ! -e "$SOURCE" ]; then
# Check if there is already an active source configuration
# and only add one if we can't find one
if ! grep -v -E '^\s*#' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null | \
grep -q -E 'deb\s+.*https?://repository(-origin)?.spotify.com\s+(stable|testing)\s+non-free'
then
tee "$SOURCE" >/dev/null 2>&1 <<EOF
deb http://repository.spotify.com stable non-free
EOF
fi
fi
```
Commenting it out allowed install to complete.
 
If you encounter such issue you probably could comment affected piece of script as rest works fine. Script is located in /var/lib/dpkg/info/spotify-client.postinstall. After commenting out affected script you could try to finish installation with:
# dpkg --configure spotify-client
I did that myself, but i don't know if it has any unforseeable side effects, do it at your discretion.
SUGGESTED POSTS