<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic `postinst` adds duplicate Spotify APT source when repository is already configured via deb822 `.sour in Desktop (Linux)</title>
    <link>https://community.spotify.com/t5/Desktop-Linux/postinst-adds-duplicate-Spotify-APT-source-when-repository-is/m-p/7331742#M24527</link>
    <description>&lt;P&gt;# Summary&lt;/P&gt;&lt;P&gt;When installing `spotify-client` using APT after configuring the Spotify repository according to the official instructions (deb822 `.sources` format), the package `postinst` script may still add `/etc/apt/sources.list.d/spotify.list`. This happens because the repository detection logic does not account for deb822 `.sources` files, resulting in duplicate repository definitions and APT warnings.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Installation Method (Important)&lt;/P&gt;&lt;P&gt;This issue does **not** occur when installing the standalone `.deb` directly.&lt;/P&gt;&lt;P&gt;Steps used:&lt;/P&gt;&lt;P&gt;1. Followed the official Spotify Linux instructions to configure the APT repository using deb822 format.&lt;BR /&gt;2. Installed the package via APT:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;apt install spotify-client&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Relevant configuration already present *before* installing the package:&lt;/P&gt;&lt;P&gt;`/etc/apt/sources.list.d/spotify.sources`&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;Types: deb&lt;BR /&gt;URIs: &lt;A href="https://repository.spotify.com" target="_blank"&gt;https://repository.spotify.com&lt;/A&gt;&lt;BR /&gt;Suites: stable&lt;BR /&gt;Components: non-free&lt;BR /&gt;Architectures: amd64&lt;BR /&gt;Signed-By: /etc/apt/keyrings/spotify.asc&lt;BR /&gt;Enabled: yes&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Spotify signing key (as documented):&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/keyrings/spotify.asc&lt;BR /&gt;Fingerprint: E109 6BCB FF6D 4187 96DE 7851 5384 CE82 BA52 C83A&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Optional but relevant policy configuration:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/preferences.d/90spotify&lt;BR /&gt;/etc/apt/apt.conf.d/90unattended-upgrades-spotify&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Problem Description&lt;/P&gt;&lt;P&gt;Despite the repository being correctly configured and active, the `postinst` script still attempts to add a legacy `.list` file:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/sources.list.d/spotify.list&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;This happens because the detection logic only scans:&lt;/P&gt;&lt;P&gt;* `/etc/apt/sources.list`&lt;BR /&gt;* `/etc/apt/sources.list.d/*.list`&lt;/P&gt;&lt;P&gt;```sh&lt;BR /&gt;find_sources() {&lt;BR /&gt;grep -v -E '^\s*#' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2&amp;gt;/dev/null&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;As a result:&lt;/P&gt;&lt;P&gt;* Existing deb822 (`.sources`) configurations are ignored&lt;BR /&gt;* `spotify.list` is created&lt;BR /&gt;* APT reports duplicate repository definitions for `&lt;A href="https://repository.spotify.com" target="_blank"&gt;https://repository.spotify.com&lt;/A&gt;`&lt;/P&gt;&lt;P&gt;This occurs even though the repository was configured explicitly, correctly, and in advance by the user using the official documentation.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Why This Matters&lt;/P&gt;&lt;P&gt;* deb822 `.sources` is the modern, recommended APT source format&lt;BR /&gt;* Users following current best practices are penalized with warnings&lt;BR /&gt;* Duplicate sources can interfere with tooling, CI, unattended upgrades, and policy-based systems&lt;BR /&gt;* The behavior is surprising when installing a package *from* that same repository&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Policy and Design Considerations&lt;/P&gt;&lt;P&gt;From a Debian packaging perspective:&lt;/P&gt;&lt;P&gt;* Maintainer scripts should not modify global APT repository configuration, especially when the package is installed via APT itself&lt;BR /&gt;* The current behavior makes sense for standalone `.deb` installs, but is inappropriate when the package is already being managed by a configured repository&lt;BR /&gt;* Repository configuration should remain an explicit user decision&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Suggested Fixes&lt;/P&gt;&lt;P&gt;## Option 1 (Recommended, policy-aligned)&lt;/P&gt;&lt;P&gt;Do not add or modify APT repository configuration in `postinst` at all.&lt;/P&gt;&lt;P&gt;If the repository is missing, print an informational message pointing users to the official setup instructions.&lt;/P&gt;&lt;P&gt;## Option 2 (Minimal change)&lt;/P&gt;&lt;P&gt;If repository auto-detection remains:&lt;/P&gt;&lt;P&gt;* Update detection logic to handle deb822 `.sources` files&lt;BR /&gt;*or*&lt;BR /&gt;* Use APT-native mechanisms (e.g. `apt-cache policy`) instead of parsing source files&lt;/P&gt;&lt;P&gt;This would prevent duplicate entries regardless of source format.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Conclusion&lt;/P&gt;&lt;P&gt;This is a real-world bug affecting users who follow the official Spotify Linux instructions and use modern APT features. It also exposes a broader design issue around repository manipulation in `postinst`.&lt;/P&gt;&lt;P&gt;Addressing this would improve correctness, reduce warnings, and better align the package with Debian and APT best practices.&lt;/P&gt;&lt;P&gt;Thank you for your consideration.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Feb 2026 08:09:28 GMT</pubDate>
    <dc:creator>ak1ra-komj</dc:creator>
    <dc:date>2026-02-07T08:09:28Z</dc:date>
    <item>
      <title>`postinst` adds duplicate Spotify APT source when repository is already configured via deb822 `.sour</title>
      <link>https://community.spotify.com/t5/Desktop-Linux/postinst-adds-duplicate-Spotify-APT-source-when-repository-is/m-p/7331742#M24527</link>
      <description>&lt;P&gt;# Summary&lt;/P&gt;&lt;P&gt;When installing `spotify-client` using APT after configuring the Spotify repository according to the official instructions (deb822 `.sources` format), the package `postinst` script may still add `/etc/apt/sources.list.d/spotify.list`. This happens because the repository detection logic does not account for deb822 `.sources` files, resulting in duplicate repository definitions and APT warnings.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Installation Method (Important)&lt;/P&gt;&lt;P&gt;This issue does **not** occur when installing the standalone `.deb` directly.&lt;/P&gt;&lt;P&gt;Steps used:&lt;/P&gt;&lt;P&gt;1. Followed the official Spotify Linux instructions to configure the APT repository using deb822 format.&lt;BR /&gt;2. Installed the package via APT:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;apt install spotify-client&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Relevant configuration already present *before* installing the package:&lt;/P&gt;&lt;P&gt;`/etc/apt/sources.list.d/spotify.sources`&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;Types: deb&lt;BR /&gt;URIs: &lt;A href="https://repository.spotify.com" target="_blank"&gt;https://repository.spotify.com&lt;/A&gt;&lt;BR /&gt;Suites: stable&lt;BR /&gt;Components: non-free&lt;BR /&gt;Architectures: amd64&lt;BR /&gt;Signed-By: /etc/apt/keyrings/spotify.asc&lt;BR /&gt;Enabled: yes&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Spotify signing key (as documented):&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/keyrings/spotify.asc&lt;BR /&gt;Fingerprint: E109 6BCB FF6D 4187 96DE 7851 5384 CE82 BA52 C83A&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Optional but relevant policy configuration:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/preferences.d/90spotify&lt;BR /&gt;/etc/apt/apt.conf.d/90unattended-upgrades-spotify&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Problem Description&lt;/P&gt;&lt;P&gt;Despite the repository being correctly configured and active, the `postinst` script still attempts to add a legacy `.list` file:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;/etc/apt/sources.list.d/spotify.list&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;This happens because the detection logic only scans:&lt;/P&gt;&lt;P&gt;* `/etc/apt/sources.list`&lt;BR /&gt;* `/etc/apt/sources.list.d/*.list`&lt;/P&gt;&lt;P&gt;```sh&lt;BR /&gt;find_sources() {&lt;BR /&gt;grep -v -E '^\s*#' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2&amp;gt;/dev/null&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;As a result:&lt;/P&gt;&lt;P&gt;* Existing deb822 (`.sources`) configurations are ignored&lt;BR /&gt;* `spotify.list` is created&lt;BR /&gt;* APT reports duplicate repository definitions for `&lt;A href="https://repository.spotify.com" target="_blank"&gt;https://repository.spotify.com&lt;/A&gt;`&lt;/P&gt;&lt;P&gt;This occurs even though the repository was configured explicitly, correctly, and in advance by the user using the official documentation.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Why This Matters&lt;/P&gt;&lt;P&gt;* deb822 `.sources` is the modern, recommended APT source format&lt;BR /&gt;* Users following current best practices are penalized with warnings&lt;BR /&gt;* Duplicate sources can interfere with tooling, CI, unattended upgrades, and policy-based systems&lt;BR /&gt;* The behavior is surprising when installing a package *from* that same repository&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Policy and Design Considerations&lt;/P&gt;&lt;P&gt;From a Debian packaging perspective:&lt;/P&gt;&lt;P&gt;* Maintainer scripts should not modify global APT repository configuration, especially when the package is installed via APT itself&lt;BR /&gt;* The current behavior makes sense for standalone `.deb` installs, but is inappropriate when the package is already being managed by a configured repository&lt;BR /&gt;* Repository configuration should remain an explicit user decision&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Suggested Fixes&lt;/P&gt;&lt;P&gt;## Option 1 (Recommended, policy-aligned)&lt;/P&gt;&lt;P&gt;Do not add or modify APT repository configuration in `postinst` at all.&lt;/P&gt;&lt;P&gt;If the repository is missing, print an informational message pointing users to the official setup instructions.&lt;/P&gt;&lt;P&gt;## Option 2 (Minimal change)&lt;/P&gt;&lt;P&gt;If repository auto-detection remains:&lt;/P&gt;&lt;P&gt;* Update detection logic to handle deb822 `.sources` files&lt;BR /&gt;*or*&lt;BR /&gt;* Use APT-native mechanisms (e.g. `apt-cache policy`) instead of parsing source files&lt;/P&gt;&lt;P&gt;This would prevent duplicate entries regardless of source format.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Conclusion&lt;/P&gt;&lt;P&gt;This is a real-world bug affecting users who follow the official Spotify Linux instructions and use modern APT features. It also exposes a broader design issue around repository manipulation in `postinst`.&lt;/P&gt;&lt;P&gt;Addressing this would improve correctness, reduce warnings, and better align the package with Debian and APT best practices.&lt;/P&gt;&lt;P&gt;Thank you for your consideration.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Feb 2026 08:09:28 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Desktop-Linux/postinst-adds-duplicate-Spotify-APT-source-when-repository-is/m-p/7331742#M24527</guid>
      <dc:creator>ak1ra-komj</dc:creator>
      <dc:date>2026-02-07T08:09:28Z</dc:date>
    </item>
  </channel>
</rss>

