Linux PMS 1.28.1.6018-c1f308c6a Install Error

Server Version#: 1.28.1.6018-c1f308c6a

sudo dpkg -i plexmediaserver_1.28.1.6018-c1f308c6a_amd64.deb
(Reading database ... 404055 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.28.1.6018-c1f308c6a_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.28.1.6018-c1f308c6a) over (1.28.0.5999-97678ded3) ...
Setting up plexmediaserver (1.28.1.6018-c1f308c6a) ...
PlexMediaServer install: PlexMediaServer-1.28.1.6018-c1f308c6a - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         video
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /tmp
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Processor:           AMD Ryzen 5 3600 6-Core Processor
PlexMediaServer install:   Config file used:    /etc/systemd/system/plexmediaserver.service.d/override.conf
PlexMediaServer install:   Nvidia GPU card:     Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
/var/lib/dpkg/info/plexmediaserver.postinst: line 697: [: =: unary operator expected
/var/lib/dpkg/info/plexmediaserver.postinst: line 698: [: =: unary operator expected
PlexMediaServer install: PlexMediaServer-1.28.1.6018-c1f308c6a - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...

Was able to correct by editing the following in /var/lib/dpkg/info/plexmediaserver.postinst: line 697 and 698:

[ $DistroName = “ubuntu” ] && [ $DistroVersion -gt 2000 ] && UseGpg=1
[ $DistroName = “debian” ] && [ $DistroVersion -ge 1000 ] && UseGpg=1

with " " around $DistroName, re-ran script plexmediaserver.postinst and no longer received error.

What exact Distro and shell? I installed on Debian 10 without issue and the script already had quotes around the distro’s.

@Renegade9

Master source code contains:

    cat <<EOF > /etc/apt/sources.list.d/plexmediaserver.list
# When enabling this repo,  Ubuntu 20+ / Debian 10+ will automatically install the signing key
# All older versions require manual installation of the key using wget:
# wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
#
# Uncomment this next line to enable the repository then update apt:  sudo apt update.
#deb https://downloads.plex.tv/repo/deb/ public main
EOF
  fi

  # If Ubuntu 20.04+ or Debian 10+, switch from using apt-key to gpg trusted keyring
  UseGpg=0

  [ $DistroName = "ubuntu" ] && [ $DistroVersion -gt 2000 ] && UseGpg=1
  [ $DistroName = "debian" ] && [ $DistroVersion -ge 1000 ] && UseGpg=1

  if [ $UseGpg -gt 0 ]; then
    HostArch="$(dpkg --print-architecture)"
    wget -q -O - https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --yes --dearmor -o /usr/share/keyrings/plexmediaserver.gpg

    if [ $? -eq 0 ]; then
      sed -i -e "s+deb https://downloads.plex.tv+deb [arch=$HostArch signed-by=/usr/share/keyrings/plexmediaserver.gpg] https://downloads.plex.tv+" \
            /etc/apt/sources.list.d/plexmediaserver.list
    else
      Output "WARNING: Unable to install Plex signing key in /usr/share/keyrings/plexmediaserver.gpg"
      Warnings=$((Warnings + 1))
    fi
  fi

  # Output final message
  if [ $Fail -eq 0 ]; then
    Output "$PMSver - Installation successful.  Errors: $Errors, Warnings: $Warnings"
    exit 0
  else
    Output "$PMSver - Installation failed.  Errors: $Errors, Warnings: $Warnings"
    Output "Additional assistance and support is available in our forums."
    exit 1
  fi

My next concern is why DistroName isn’t populated which would have worked regardless of quotes.

Is /bin/bash linked to something else ?

Hi,

Sorry for the confusion, it was erroring because “” was not around $DistroName variable ie “$DistroName” not “” around ubuntu or debian

Corrected code should be:

[ "$DistroName" = "ubuntu" ] && [ $DistroVersion -gt 2000 ] && UseGpg=1
[ "$DistroName" = "debian" ] && [ $DistroVersion -ge 1000 ] && UseGpg=1

Debian Linux 11
Kernel: Linux 5.16.0-0.bpo.4-amd64 on x86_64

Edit:
Confirmed issues is still happening with latest dev build, same resolution to correct error

sudo dpkg -i plexmediaserver_1.28.1.6041-738907df3_amd                                                                       64.deb
(Reading database ... 404081 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.28.1.6041-738907df3_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.28.1.6041-738907df3) over (1.28.1.6018-c1f308c6a) .                                                                       ..
Setting up plexmediaserver (1.28.1.6041-738907df3) ...
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation st                                                                       arting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         video
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library                                                                       /Application Support
PlexMediaServer install:   Temp Directory:      /tmp
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Processor:           AMD Ryzen 5 3600 6-Core Processo                                                                       r
PlexMediaServer install:   Config file used:    /etc/systemd/system/plexmediaser                                                                       ver.service.d/override.conf
PlexMediaServer install:   Nvidia GPU card:     Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
/var/lib/dpkg/info/plexmediaserver.postinst: line 697: [: =: unary operator expe                                                                       cted
/var/lib/dpkg/info/plexmediaserver.postinst: line 698: [: =: unary operator expe                                                                       cted
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation su                                                                       ccessful.  Errors: 0, Warnings: 0
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...

Again, I am not understanding. There should be no errors at all.
The line number being reported makes no sense whatsoever.

DistroName is returned by quering /etc/os-release

DistroName="$(grep ^ID= /etc/os-release)" ; DistroName="${DistroName//[^.]*=/}"

Can you show me your /etc/os-release?

PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian
HOME_URL=“https://www.debian.org/”
SUPPORT_URL=“https://www.debian.org/support”
BUG_REPORT_URL=“https://bugs.debian.org/”

If I run the following:

DistroName="$(grep ^ID= /etc/os-release)" ; DistroName="${DistroName//[^.]*=/}"
echo $DistroName
debian

Here is a stack overflow about this same error with variable comparisons:

ID=debian

is exactly what I expect.

Please observe.

[chuck@lizum debian.2007]$ DistroName="ID=debian"
[chuck@lizum debian.2008]$ DistroName="${DistroName//[^.]*=/}"
[chuck@lizum debian.2009]$ echo $DistroName
debian
[chuck@lizum debian.2010]$

There is no reason it should fail for you when it works on Ubuntu

    # Where is Beignet available and viable ? (below 21.04)
    [ "$DistroName" = "ubuntu" ] && [ $DistroVersion -lt 2100 ] && BeignetAvailable=1
    [ "$DistroName" = "debian" ]                                && BeignetAvailable=1

There must be a reason… but what is it???

I will quickly setup a new Debian 11 and retest

done. Here we are.

chuck@debian11:~/Downloads$ sudo dpkg -i plexmediaserver_1.28.1.6041-738907df3_amd64.deb 
(Reading database ... 148860 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.28.1.6041-738907df3_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.28.1.6041-738907df3) over (1.28.0.5999-97678ded3) ...
Setting up plexmediaserver (1.28.1.6041-738907df3) ...
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation starting.
PlexMediaServer install: 
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         render
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /tmp 
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Processor:           Intel(R) Core(TM) i7-8809G CPU @ 3.10GHz
PlexMediaServer install:   Intel i915 Hardware: Not found
PlexMediaServer install:   Nvidia GPU card:     Not Found
PlexMediaServer install:  
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...
chuck@debian11:~/Downloads$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
chuck@debian11:~/Downloads$ date
Mon 08 Aug 2022 11:05:42 PM EDT
chuck@debian11:~/Downloads$

Hi ChuckPa,

Thanks for such a quick reply. Please note the use of “” around $DistroName if the code you posted above for your comparison of “$DistroName” = “debian” within single . With that it will work as intended, however lines 697 and 698 are missing “” around $DistroName within /var/lib/dpkg/info/plexmediaserver.postinst.

This can be solved by either using [] around the variable comparison or by editing the lines to be “$DistroName” instead of $DistroName

Please look above.

Using the current beta, which I just downloaded, I cannot reproduce your failure.

Hi ChuckPa,

Does line 697/698 in /var/lib/dpkg/info/plexmediaserver.postinst on your machine contain:

[ $DistroName = "ubuntu" ] && [ $DistroVersion -gt 2000 ] && UseGpg=1
[ $DistroName = "debian" ] && [ $DistroVersion -ge 1000 ] && UseGpg=1

or

[ "$DistroName" = "ubuntu" ] && [ $DistroVersion -gt 2000 ] && UseGpg=1
[ "$DistroName" = "debian" ] && [ $DistroVersion -ge 1000 ] && UseGpg=1

No they do not nor do they need it.

chuck@debian11:~/Downloads$ A=hi
chuck@debian11:~/Downloads$ [ $A = hi ] && echo YES
YES
chuck@debian11:~/Downloads$ [ $A = low ] && echo YES
chuck@debian11:~/Downloads$ 

= is already a string comparison operator.
"thing* Something" prevents unexpected globbing and allows inclusion of spaces, neither of which can appear in the value.

Hi,

Would you be able to provide the query used for $DistroVersion? Just to double check manually to make sure the query would work with the rest of the && statement on my machine.

The only other thing I could think of is if $DistroName isn’t being populated correctly within the script causing a none existing value to be compared to.

I noticed the following setting variables at the top of /var/lib/dpkg/info/plexmediaserver.postinst but haven’t dug elsewhere in the code for it

DistroName="$(GetConfig DistroName)"
DistroVersion="$(GetConfig DistroVersion)"

The function GetConfig() is used to pass info from preinstall → postinstall.

I write the results of preinst to /tmp/plexinstaller.log
To prevent privilege escalation attacks, I use GetConfig to read the values from /tmp/plexinstaller.log and set the corresponding variables in postinst for use.

I noticed you’re using 1.28.1.6018. I’m not familiar with that build. (never saw it)
I am familiar with PlexPass version

plexmediaserver_1.28.1.6041-738907df3_amd64.deb

Would you mind downloading and installing?

Hi,

I originally saw the error with 1.28.1.6018 but have since updated as well to 1.28.1.6041, the install logs are above but I will just post them again for ease of use.

sudo dpkg -i samba/plexmediaserver_1.28.1.6041-738907df3_amd64.deb
(Reading database ... 404081 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.28.1.6041-738907df3_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.28.1.6041-738907df3) over (1.28.1.6018-c1f308c6a) ...
Setting up plexmediaserver (1.28.1.6041-738907df3) ...
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         video
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /tmp
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Processor:           AMD Ryzen 5 3600 6-Core Processor
PlexMediaServer install:   Config file used:    /etc/systemd/system/plexmediaserver.service.d/override.conf
PlexMediaServer install:   Nvidia GPU card:     Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
/var/lib/dpkg/info/plexmediaserver.postinst: line 697: [: =: unary operator expected
/var/lib/dpkg/info/plexmediaserver.postinst: line 698: [: =: unary operator expected
PlexMediaServer install: PlexMediaServer-1.28.1.6041-738907df3 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...

Thanks for all your help with this ChuckPa, much appreciated!

Now I have to point to your machine RELUCTANTLY.

Which specific Debian 11 update are you running? I am 11.3
Does it have all updates ?

There is something afoot in that install. It’s annoying me :angry:

Hi,

I am not sure what subversion (If you know the command I can run it) but here is my current config:

 uname -r
5.16.0-0.bpo.4-amd64
 lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

That’s not the default 11.3 kernel.
Debian usually lags behind everyone else.
Ubuntu is shipping 5.15 kernel.

You installed that yourself?

chuck@debian11:~/Downloads$ uname -r
5.10.0-15-amd64
chuck@debian11:~/Downloads$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye
chuck@debian11:~/Downloads$ 

5.16.0-0.bpo.4-amd64 kernel was installed through backports, I needed it for better support for a few drivers/devices and for updated zfs version for my system

My /etc/apt/sources.list file

deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye main contrib non-free

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

# bullseye-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free

deb [arch=amd64] https://download.docker.com/linux/debian/ bullseye stable

My /etc/apt/sources.list.d/bullseye-backports.list file

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free