Enable repository updating on Ubuntu

Server Version#: 4.147.1

Player Version#: N/A

Running Ubuntu 22.04 with Cinnamon desktop environment.

I got an email today: Action Required to Update Plex Media Server on Linux Systems. This redirects to the web page https://support.plex.tv/articles/235974187-enable-repository-updating-for-supported-linux-server-distributions/ containing the support article “Enable repository updating for supported Linux server distributions.”

This contains step by step instructions on what to run from a command line.

Everything is fine until the following code, which returns a “permissions denied” error: sudo echo “deb [signed-by=/etc/apt/keyrings/plexmediaserver.v2.gpg] https://repo.plex.tv/deb/ public main” > /etc/apt/sources.list.d/plex.list. Edit: the error is specifically “bash: /etc/apt/sources.list.d/plex.list: Permission denied”

I am a member of the admins group and I am typing sudo at the beginning of the line. So permissions denied is a mystery to me. There are no instructions in the support article as to what to do. If I’m going to do this I need help. Thank you.

This has nothing to do with plex but rather something is configured wrong with your system.

For some reason, using sudo does not give you privileges to write to /etc/apt/sources.d/, witch is very odd, but it has nothing to do with plex.

You can type sudo -ll and it will show you what your user has privileges to when using sudo.
One of the entries should say something like:

User <username> may run the following commands on <hostname>:

Sudoers entry:
    RunAsUsers: ALL
    RunAsGroups: ALL
    Commands:
        ALL

witch means you are able to run any command as sudo (root) and thereby have access to everything root has access to.
All the command does that fails for you is to echo (add the text with the key) into the file /etc/apt/sources.list.d/plex.list

I also don’t think adm group is super important, what is important is the sudo group, but I could be wrong, I haven’t used ubuntu for a very long time…

For more support, you should turn to a better forum, like a forum for the distro you are using, in this case ubuntu.

Edit
Wait, I had a brain fart…
The redirection will fail due to it trying to run as your user… Try using a pipe with tee also ran as sudo.
The instructions should be: (notice I also changed the path to use the CORRECT path instead of the wrong that is mentioned in their instructions:

curl -L https://downloads.plex.tv/plex-keys/PlexSign.v2.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/plexmediaserver.v2.gpg
echo "deb [signed-by=/usr/share/keyrings/plexmediaserver.v2.gpg] https://repo.plex.tv/deb/ public main" | sudo tee /etc/apt/sources.list.d/plex.list

Thank you. What you suggested in your edit worked. Is there a way to let Plex know that their support article has a bug?

I made a comment about it here as they request in the email

Don’t feel bad about this, this is 100% plex making a complete mess of this situation, providing wrong instructions, multiple times…