[Bug]: debian apt update && apt upgrade causing full apt update failure due to error "useradd: user 'audiobookshelf' already exists" #1032

Closed
opened 2026-04-24 23:29:31 +02:00 by adam · 4 comments
Owner

Originally created by @solajim on GitHub (Mar 19, 2023).

Describe the issue

The apt upgrade functionality in debian is failing due to audiobookshelf. It seems the service is trying to create a service account even though the service account already exists, and so encounters an error.

This causes the command to crash, leaving all other apt packages in a non-functional state.

root@arcturus:~# apt dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  gir1.2-goa-1.0 libxmlb1
Use 'apt autoremove' to remove them.
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
...
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages will be upgraded:
  audiobookshelf [truncated]
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 101 MB of archives.
After this operation, 1,111 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 [omitted]
Get:2 [omitted]
Get:3 https://advplyr.github.io/audiobookshelf-ppa ./ audiobookshelf 2.2.17 [16.2 MB]
Get:4 [omitted]
...
Get:9 [omitted]
Fetched 101 MB in 2s (41.9 MB/s)
Preconfiguring packages ...
(Reading database ... 285854 files and directories currently installed.)
Preparing to unpack ...
Warning: Stopping motd-news.service, but it can still be activated by:
  motd-news.timer
Unpacking base-files ...
Setting up base-files ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
motd-news.service is a disabled or a static unit, not starting it.
(Reading database ... 285854 files and directories currently installed.)
[truncated]
Preparing to unpack .../5-audiobookshelf_2.2.17_amd64.deb ...
Removed /etc/systemd/system/multi-user.target.wants/audiobookshelf.service.
Creating system user: audiobookshelf in audiobookshelf with audiobookshelf user-daemon and shell /bin/false
useradd: user 'audiobookshelf' already exists
dpkg: error processing archive /tmp/apt-dpkg-install-YUw2jl/5-audiobookshelf_2.2.17_amd64.deb (--unpack):
 new audiobookshelf package pre-installation script subprocess returned error exit status 9
Created symlink /etc/systemd/system/multi-user.target.wants/audiobookshelf.service → /lib/systemd/system/audiobookshelf.service.
[truncated]
Errors were encountered while processing:
 /tmp/apt-dpkg-install-YUw2jl/5-audiobookshelf_2.2.17_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Steps to reproduce the issue

  1. Upgrade from v2.2.12 to latest via "apt dist-upgrade"

Audiobookshelf version

v2.2.12

How are you running audiobookshelf?

Debian/PPA

Originally created by @solajim on GitHub (Mar 19, 2023). ### Describe the issue The apt upgrade functionality in debian is failing due to audiobookshelf. It seems the service is trying to create a service account even though the service account already exists, and so encounters an error. This causes the command to crash, leaving all other apt packages in a non-functional state. ``` root@arcturus:~# apt dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: gir1.2-goa-1.0 libxmlb1 Use 'apt autoremove' to remove them. Get more security updates through Ubuntu Pro with 'esm-apps' enabled: ... Learn more about Ubuntu Pro at https://ubuntu.com/pro The following packages will be upgraded: audiobookshelf [truncated] 9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 101 MB of archives. After this operation, 1,111 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 [omitted] Get:2 [omitted] Get:3 https://advplyr.github.io/audiobookshelf-ppa ./ audiobookshelf 2.2.17 [16.2 MB] Get:4 [omitted] ... Get:9 [omitted] Fetched 101 MB in 2s (41.9 MB/s) Preconfiguring packages ... (Reading database ... 285854 files and directories currently installed.) Preparing to unpack ... Warning: Stopping motd-news.service, but it can still be activated by: motd-news.timer Unpacking base-files ... Setting up base-files ... Installing new version of config file /etc/issue ... Installing new version of config file /etc/issue.net ... Installing new version of config file /etc/lsb-release ... motd-news.service is a disabled or a static unit, not starting it. (Reading database ... 285854 files and directories currently installed.) [truncated] Preparing to unpack .../5-audiobookshelf_2.2.17_amd64.deb ... Removed /etc/systemd/system/multi-user.target.wants/audiobookshelf.service. Creating system user: audiobookshelf in audiobookshelf with audiobookshelf user-daemon and shell /bin/false useradd: user 'audiobookshelf' already exists dpkg: error processing archive /tmp/apt-dpkg-install-YUw2jl/5-audiobookshelf_2.2.17_amd64.deb (--unpack): new audiobookshelf package pre-installation script subprocess returned error exit status 9 Created symlink /etc/systemd/system/multi-user.target.wants/audiobookshelf.service → /lib/systemd/system/audiobookshelf.service. [truncated] Errors were encountered while processing: /tmp/apt-dpkg-install-YUw2jl/5-audiobookshelf_2.2.17_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) ``` ### Steps to reproduce the issue 1. Upgrade from v2.2.12 to latest via "apt dist-upgrade" ### Audiobookshelf version v2.2.12 ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:29:31 +02:00
adam closed this issue 2026-04-24 23:29:31 +02:00
Author
Owner

@nichwall commented on GitHub (Nov 9, 2024):

Is this still an issue? The server is currently on version 2.16.2

@nichwall commented on GitHub (Nov 9, 2024): Is this still an issue? The server is currently on version 2.16.2
Author
Owner

@mnw700x commented on GitHub (Mar 3, 2025):

I've been stuck on this same problem since version 2.17.7 with Ubuntu 24.04 I've tried reinstalling it a few times but no luck. Since 2.17 keeps on working with the app I haven't been too frantic about it but I would like to upgrade eventually. Is this a packaging error or something? Figured I'd chime in since I was searching this exact error again today.

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble

Node.js v20.11.1

@mnw700x commented on GitHub (Mar 3, 2025): I've been stuck on this same problem since version 2.17.7 with Ubuntu 24.04 I've tried reinstalling it a few times but no luck. Since 2.17 keeps on working with the app I haven't been too frantic about it but I would like to upgrade eventually. Is this a packaging error or something? Figured I'd chime in since I was searching this exact error again today. No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble Node.js v20.11.1
Author
Owner

@andycopypaste commented on GitHub (Mar 28, 2025):

@mnw700x I was having the same issue, stuck at v2.17.7. After a bunch of digging I ended up just needing to change a line in the sources file from "Enabled: no" to "Enabled: yes" and it updated.

The file should be at /etc/apt/sources.list.d/audiobookshelf.sources

@andycopypaste commented on GitHub (Mar 28, 2025): @mnw700x I was having the same issue, stuck at v2.17.7. After a bunch of digging I ended up just needing to change a line in the sources file from "Enabled: no" to "Enabled: yes" and it updated. The file should be at /etc/apt/sources.list.d/audiobookshelf.sources
Author
Owner

@github-actions[bot] commented on GitHub (Dec 21, 2025):

Fixed in v2.32.0.

@github-actions[bot] commented on GitHub (Dec 21, 2025): Fixed in [v2.32.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.32.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1032