! Conditions:
! - Usually after "Operation failed" message during update or installation attempts.
! In this example is used 64 bit Plex v.1.40.0.7998-c29d4c0c8 from February 13, 2024
! - For 4.2.30 and close TOS versions
! - NAS is with well working Internet connectivity
! - SSH connection to the NAS - all commands are executed from the bash
!
! [1] Remove any Plex file from the NAS (WARNING: verify if the locations are as described first!)
!
Code: Select all
rm -rf /mnt/md0/application/pkgs/plex
rm /mnt/md0/application/pkgs/plex.tpk
rm -rf /mnt/md0/application/plexmediaserver/
rm -rf /mnt/md0/application/uninstall/plex
!
! [2] Remove ny old user and create a new one, ready for the Plex installation
!
Code: Select all
deluser plex
groupadd -g 5555 plex
useradd -M -u 5555 plex -g plex -d /home/plex -s /bin/bash
!
! [3] Install Plex from package
!
! Applications > Settings > Install Application Manually
! WARNING: It will fail, but no worries
!
! [4] Validate the reson for the failure and correct it
!
Code: Select all
cd /mnt/md0/application/pkgs
./plex/etc/init.d/plex status
./plex/etc/init.d/plex start
start-stop-daemon: unable to stat /usr/local/plexmediaserver/Plex Media Server (No such file or directory)
!
! In this example, the above message is showing a missing directory that the Plex installation is expecting
! in a specific place (/usr/local/plexmediaserver/).
!
! A fast investigation is identifying the actual location for the directory (/home/plex/Library/Application Support/):
!
Code: Select all
ls -al /usr/local/plexmediaserver
total 0
drwxr-xr-x 1 root root 24 Feb 17 21:03 .
drwxr-xr-x 1 root root 230 Feb 17 20:52 ..
drwxr-xr-x 1 root root 0 Feb 17 21:03 lib
drwxr-xr-x 1 root root 150 Feb 17 21:03 Resources
!
Code: Select all
ls -al /home/plex/Library/Application\ Support/
total 0
drwxr-xr-x 1 plex plex 34 Feb 17 20:53 .
drwxr-xr-x 1 plex plex 38 Feb 17 20:53 ..
drwxr-xr-x 1 plex plex 270 Feb 17 21:03 'Plex Media Server'
!
! Correcting the missing directory in creating a symbolic link to the actual location:
!
Code: Select all
cd /usr/local/plexmediaserver
ln -s /home/plex/Library/Application\ Support/Plex\ Media\ Server/ 'Plex Media Server'
ls -al
total 4
drwxr-xr-x 1 root root 58 Feb 17 21:26 .
drwxr-xr-x 1 root root 230 Feb 17 20:52 ..
drwxr-xr-x 1 root root 0 Feb 17 21:03 lib
lrwxrwxrwx 1 root root 57 Feb 17 21:26 'Plex Media Server' -> '/home/plex/Library/Application Support/Plex Media Server/'
drwxr-xr-x 1 root root 150 Feb 17 21:03 Resources
!
! We can use now "plex start" again to validate if there are more problems to fix...
! In that example there are no other issue.
!
!
! [5] Install Plex from package
!
! Applications > Settings > Install Application Manually
!
! The installation should pass and the Plex icon will be placed on the TOS desktop.