Server Version#: 1.23.1.4528
Player Version#: Not relevant
OS: Debian Unstable but Debian Stable same version is about to be released.
I complained some time ago about apt errors when upgrading that required me to remove /var/lib/dpkg/info/plexmediaserver.postinst after each upgrade. Plex worked fine but apt threw errors - was told wontfix because development version of Debian and I understand that but I think I’ve found the issue.
Plex used to have a great article about using a systemd override to change some parameters like library location and I also used that systemd override to run PMS under my user account which I understand is not supported.
Could that be why PMS postinstall script is throwing apt errors?
User plex is required to exist even if not used. This provides a failsafe for when overrides fail.
useradd creates $HOME which is /var/lib/plexmediaserver for user plex.
The installer code does only the following after verifying user plex exists.
# If default directories aren't there, create them (Presence always required, even if empty)
if [ ! -d "/var/lib/plexmediaserver/Library/Application Support" ]; then
# Make the PMS directory
mkdir -p "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server"
if [ $? -ne 0 ]; then
Output "ERROR: Cannot create required directory '/var/lib/plexmediaserver/Library/Application Support/Plex Media Server' Error: $?"
Errors=$((Errors + 1))
Fail=1
fi
# Set ownership of all to plex:plex
chown -R plex:plex /var/lib/plexmediaserver
if [ $? -ne 0 ]; then
Output "ERROR: Cannot set ownership of '/var/lib/plexmediaserver' to user 'plex:plex'. Error: $?"
Errors=$((Errors + 1))
Fail=1
fi