Manually updating Plex on FreeNAS, including PlexPass versions. -PMS_Updater.sh

Are you running Plex Media Server on FreeNAS as a plugin, but don’t like waiting for the updates from FreeNAS?
PMS_Updater for FreeNAS is exactly what you need!

PMS_Updated allows you to update the FreeNAS Plex install from CLI with out waiting for the plugin updates from the devs, the updater will connect to your specified jail, download the most recent version of Plex and run the update if needed.

To do so, first we need to either access our FreeNAS console, or login via SSH. (for Windows users, check out Putty)
Once logged into your FreeNAS server, you want to determine what Jail number your Plex server is installed in, to do so execute the following

jls

You will get an output of Jails installed, choose your Plex Server. In this example mine is 1.
Our next line with log into that Jail to update Plex, so be sure to use the number from the jls command above.

jexec 1 csh

The first time you run this, you may need to install the following.

pkg install ca_root_nss
pkg install wget
pkg install perl5

Once in the Jail, we can download the PMS_Update script

fetch -o PMS_Updater.sh https://raw.githubusercontent.com/mstinaff/PMS_Updater/master/PMS_Updater.sh

Or for PlexPass use

fetch -o PMS_Updater.sh https://raw.githubusercontent.com/luluhoc/PMS_Updater/master/PMS_UpdaterPLEXPASS.sh

After the appropriate updater is downloaded, make sure to modify the permissions for the file to execute correctly.

chmod 755 PMS_Updater.sh

And then execute the script.

./PMS_Updater.sh -vv -a

You should now be on the latest version of Plex, you may need to start your Plex Server in the FreeNAS plugins page.


For a list of known issues and bugs, please check the Issues Page from the Author of this script.
At the time of writing this article (3/23/19), there are 2 known bugs with the current release.


Forcing an update when all else fails

A few times the script above has failed me, to get around I still execute the jexec for the jail I wish to update.

jexec 1
fetch -o PMS_Updater.sh https://raw.githubusercontent.com/luluhoc/PMS_Updater/master/PMS_UpdaterPLEXPASS.sh
chmod 755 PMS_Updater.sh 

And I then use WinSCP to copy the install files over to the plex jail location. The installers can be downloaded from Plex.tv and choosing FreeBSD.

And then execute the following command. (Just be sure to name the downloaded Plex server files to PlexBuild.tar.bz2)

./PMS_Updater.sh -l PlexBuild.tar.bz2 -vv -a

38 thoughts on “Manually updating Plex on FreeNAS, including PlexPass versions. -PMS_Updater.sh”

    • I looked at the live files just now and it does appear both serve the same purpose now, with the option for “-n” for a normal Plex install rather than PlexPass.

      I will work updating this doc over this upcoming weekend.

      Reply
  1. Thanks so much for this tutorial. It was easy and worked the first time (after I fixed my typo’s). You made it very easy to follow and understand. I have printed it and will refer to it whenever Plex says there is an update.
    Many Thanks For A Job Well Done.
    Bob Ivey

    Reply
  2. Looks like the -n option doesn’t stop the correct service if you’re a non-plex pass user and that the service name is hard-coded.

    root@plex:/ # grep service /PMS_Updater.sh
    service plexmediaserver_plexpass stop 2>&1
    service plexmediaserver_plexpass start

    I worked around this by symlinking

    lrwxr-xr-x 1 root wheel 15 Aug 28 15:19 /usr/local/etc/rc.d/plexmediaserver_plexpass -> plexmediaserver

    and it appears to do the needful.

    Reply
  3. Thanks for the great article you saved me from waiting plugin updates and your method using WinSCP so easy than any other I have seen.

    Reply
  4. This is awesome. I tried I think an older version of this many years ago and ending up nuking my entire install, lol. I definitely want to try this however I have one concern.

    I started out with the original plug in as there was no plex pass plugin at that time. But, I did end up buying a plex pass. Now I’m not sure if I should use the updater or the plexpass?

    Thanks again.

    Reply
  5. Just an FYI, I had to Change “enabled: no” to “enabled: yes” in /usr/local/etc/pkg/repos/FreeBSD.conf in order to get access to the standard FreeBSD repository to install wget since the IOcage repository doesn’t have it.

    Reply
  6. the non-plexpass function wasn’t working properly – it kept installing to a plexmediaserver-plexpass folder, despite indicating with -n that this was not a plexpass installation. Along with what Sean said above:
    lrwxr-xr-x 1 root wheel 15 Aug 28 15:19 /usr/local/etc/rc.d/plexmediaserver_plexpass -> plexmediaserver
    I also symlinked the installation folder
    lrwxr-xr-x 1 root wheel 15 Sep 20 22:42 /usr/local/share/plexmediaserver-plexpass -> plexmediaserver

    Note lines 9&10 in PMS_Updater.sh

    Reply
  7. So I installed FreeNAS/Plex about 12 months ago and added my library. I have some customizations that I don’t want to lose (ie. Sort Titles, etc).

    I bought Plex Pass about 6 months ago. Should I “upgrade” to the Plex Pass version? Whats the difference? and if so, how do I save all my preferences/sort titles/etc. so I dont have to redo them all for my library.

    Reply
  8. oh my..what a script. here’s the all-in-one instruction:

    sed “s/enabled: no/enabled: yes/g” /usr/local/etc/pkg/repos/FreeBSD.conf > /usr/local/etc/pkg/repos/FreeBSD.conf;
    pkg update;
    pkg install ca_root_nss;
    pkg install wget;
    pkg install perl5;
    fetch -o PMS_Updater.sh https://raw.githubusercontent.com/mstinaff/PMS_Updater/master/PMS_Updater.sh;
    sed “s/[_-]plexpass//g” PMS_Updater.sh > PMS_Updater_fixed.sh
    #fetch -o PMS_Updater.sh https://raw.githubusercontent.com/luluhoc/PMS_Updater/master/PMS_UpdaterPLEXPASS.sh;
    chmod 755 PMS_Updater_fixed.sh;
    ./PMS_Updater_fixed.sh -vv -a;

    CHECK Up to date – in 10 seconds

    Reply
  9. I keep getting the following error:

    root@plex:/ # pkg install wget
    Updating iocage-plugins repository catalogue…
    iocage-plugins repository is up to date.
    All repositories are up to date.
    pkg: No packages available to install matching ‘wget’ have been found in the repositories

    Is wget no longer an available package?

    Reply
    • To get the FreeBSD installer, goto the Plex.tv Downloads page, choose “Plex Media Server” and click the drop down for FreeBSD.
      From there you should be able to atleast SACP the files sto your server, then manually update

      Plex FreeBSD

      Reply
      • Do you mind please giving a bit more instructions on this? I’m also struggling to update, I’m having the same issue as Mathijs.

        Also, I’m on Freenas 11.0 and I see that the latest Plex requires FreeBSD 11.2 or newer, is it wise for me to update Plex?

        Reply
        • You can manually download Plex from their website and grab the FreeBSD server version.
          https://www.plex.tv/media-server-downloads/
          From there, follow the WinSCP instructions to copy the files to your FreeNAS box and install them via putty, under the “Forcing an update when all else fails” section.

          I would for SURE update your FreeNAS system first, you want to be on the latest version of FreeNAS

          Reply
          • Thanks for the instructions!

            I tried updating to 11.3 but my jails went missing so I had to roll back. I’ll dedicate some time soon to sort it out properly.

  10. Been using this method of updating for several month and works without a hitch. I upgraded FreeNas to 11.3 but can’t figure out how to update the jail itself to 11.3. Running this command gives this error:
    iocage upgrade -r 11.3-RELEASE plex

    Snapshotting plex…
    Snapshot already exists
    Updating plugin INDEX…
    Traceback (most recent call last):
    File “/usr/local/bin/iocage”, line 10, in
    sys.exit(cli())
    File “/usr/local/lib/python3.7/site-packages/click/core.py”, line 764, in __call__
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python3.7/site-packages/click/core.py”, line 717, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python3.7/site-packages/click/core.py”, line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python3.7/site-packages/click/core.py”, line 555, in invoke
    return callback(*args, **kwargs)
    File “/usr/local/lib/python3.7/site-packages/iocage_cli/upgrade.py”, line 40, in cli
    ioc.IOCage(jail=jail, skip_jails=skip_jails).upgrade(release)
    File “/usr/local/lib/python3.7/site-packages/iocage_lib/iocage.py”, line 2065, in upgrade
    ).upgrade(jid)
    File “/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_plugin.py”, line 1251, in upgrade
    self.iocroot, ‘jails’, self.jail, f'{plugin_name}.json’
    File “/usr/local/lib/python3.7/shutil.py”, line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
    File “/usr/local/lib/python3.7/shutil.py”, line 120, in copyfile
    with open(src, ‘rb’) as fsrc:
    FileNotFoundError: [Errno 2] No such file or directory: ‘/mnt/Tank-Striped-Mirrors/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/plex.json’

    Reply
  11. I have FreeNAS-11.3-U1 with a jailed Plex Server that was 18.2.2058. Followed the first instructions and worked like charm! Plex now at 1.19.1.2589 without any issues as of 4/2/2020. Searched for a week and tried all other methods.

    Reply
  12. I wanted to thank you very much! I haven’t been able to get the Plex package to update since mid January. Your “when all else fails” tutorial did the trick. I’ve Favorited this page. THANKS!

    Reply
  13. I wish I would have found your post first! I tried so many other methods and one resulted in me deleting everything and starting over.
    Your instructions are so clear and simple. The script makes everything effortless.

    Thank you!

    Reply
  14. NICE post! Worked like a complete charm on FreeNAS-11.3-U3. Awesome work and thanks for sharing!

    Cheers from Córdoba, Argentina,

    Matías.-

    Reply
  15. In FreeNAS, Tasks > Cron Jobs > name it whatever you want and use iocage exec plex ./PMS_Updater.sh -vv -a > Set the schedule to whatever you want. I have mine do it every Wednesday at 3am

    Reply
  16. I have used this a couple of times, and am a complete novice when it comes to this stuff, but I am so relieved that this process absolutely works, thank you so much for sharing the details.

    Reply

Leave a Comment