Plex Media Scanner New Path - Ubuntu

Server Version#: 1.15.0.659
Player Version#: N/A
It seems like in the latest version of PMS the path for Plex Media Scanner has changed which is now causing some external scripts i have to fail.
It seems like a large amount of files have moved from /usr/lib/plexmediaserver/ to /usr/lib/plexmediaserver/lib but the actual “Plex Media Scanner” file is still in its original location.

Calling

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
$LD_LIBRARY_PATH/Plex\ Media\ Scanner --scan --refresh --section 2 --directory "/mnt/unionfs/Media/TV/The Grand Tour (2016)"

fails with

/usr/lib/plexmediaserver/Plex Media Scanner: error while loading shared libraries: libva.so.2: cannot open shared object file: No such file or directory

And then running

$LD_LIBRARY_PATH/lib/libva.so.2 --scan --refresh --section 2 --directory "/mnt/unionfs/Media/TV/The Grand Tour (2016)"

fails with

bash: /usr/lib/plexmediaserver/lib/libva.so.2: Permission denied

Running as root doesn’t fix that either. I feel like i need to call “Plex Media Scanner” from a new location?

Just ran into this as well with my scripts. Updated my the LD_LIBRARY_PATH environment variable to reflect the new lib path:

Change:

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver

to:

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib

EDIT: For backwards compatibility (should you need it), you can just append the new lib path to the end of your previous export statement:

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib

Then, run your scripts or commands as normal.

I’m not sure about the permission errors that you are seeing. I typically run my Plex Scan script as the plex user and have never seen such an error. Check the permissions on the file and make sure that everyone has read access to it.

ls -lh /usr/lib/plexmediaserver/lib/libva.so.2

Permissions should look something like this:

-rw-r--r-- 1 root root 136K Feb  7 06:51 libva.so.2

If for some reason the output looks different from mine, I’d suggest changing ownership and permissions of all of your libraries.

sudo chmod -R 644 /usr/lib/plexmediaserver/lib/*
sudo chown -R root:root /usr/lib/plexmediaserver/lib/*

Can confirm just setting

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib

Fixes the issue, i was initially also changing my scanner path too which isn’t required.

1 Like

To clarify for all:

All shared libraries were relocated to /usr/lib/plexmediaserver/lib
This cleaned up the main /usr/lib/plexmediaserver directory

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.