Plex Update on Ubuntu 18.04.2 LTS


So recently I've been having an issue with my Plex Media Server (PMS) where the Hama scanner plugin gets stuck in a constant loop maxing out one core of my cpu to endlessly scan my files. Not sure why this is, most likely cause is a corrupt media file somewhere. So While I'll probably eventually have to find that file at some point I thought I'd take the time to update plex and the Hama plugin at the same time.

Updating Plex

Because I have the Plex distribution package enabled I can simply use sudo apt update && sudo apt upgrade to update all packages including Plex. Then the service needs to be restarted with sudo service plexmediaserver stop

However, this did not fix the issue with the scanner, so I now have to update that separately because it's not a stock service but a plugin i added.

Updating Hama

Luckily there is a handy sequence of code that someone wrote up to install and update Hama and ASS easily and quickly. So I ended up plugging those into my system and they worked like a charm. I did have to sudo rm a file when it was getting stuck, but once that was finished everything else worked like it should.

sudo service plexmediaserver stop cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/Hama.bundle sudo git reset --hard && sudo git pull cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Scanners/Series/ wget -N && cd sudo chown -R plex:plex /var/lib/plexmediaserver sudo chmod 775 -R /var/lib/plexmediaserver sudo touch /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Data/com.plexapp.agents.hama/StoredValues sudo chmod 777 /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Data/com.plexapp.agents.hama/StoredValues sudo chown plex:plex /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Data/com.plexapp.agents.hama/StoredValues sudo service plexmediaserver restart

Final Notes

It seems that everything is now working as it should. Looks like it wasn't a corrupt media file after all but rather a a corrupt file in the Hama scanner files. I should not that I also made sure to optimize the database and clean the bundles after most steps throughout this process.

Hopefully everything stays working from now on!

Plex Install Guide
Hama and ASS Install Guide