[Solved] Unsure what to do regarding YAMS binary

Do you have issues upgrading YAMS from v1 to v2? Post your questions here!
Post Reply
Proto
Posts: 4
Joined: Mon Oct 30, 2023 3:47 pm
Gender:
Wales

[Solved] Unsure what to do regarding YAMS binary

Post by Proto »

I will stress I am very much a newbie to Linux. Using it with YAMS is kind of a way for me to mess around with the OS and learn while also being the simplest way to get a media serve up and running with very few headaches. So great job in that regard.

I'm following the instructions on how to upgrade YAMS v1 to v2 and I'm getting stumped at the section regarding setting up the YAMS binaries. I understand I'm meant to be replacing some variables in the commands to run e.g in the case of the first line 'sed -i -e "s|<filename>|/opt/yams/docker-compose.yaml|g" yams' I need to replace where it says filename. Whats stumping me what I'm supposed to replace it with? Is it a name of my choosing or a specific file name in one of the YAMS related folders? Its probably just starting at me in the face and I'm just having a dumb moment.

Any advice would be most appreciated.

User avatar
rogs
Site Admin
Posts: 167
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: Unsure what to do regarding YAMS binary

Post by rogs »

Hey @Proto!

Now that you mention it, I should have done it a little more explicit. Let me explain a little better :D

- sed -i -e "s|<filename>|/opt/yams/docker-compose.yaml|g" yams

You need to replace /opt/yams/docker-compose.yaml with the location of your docker-compose file. If you used the default install location when you set up YAMS, then the command is ready to use. You can confirm this by running:

Code: Select all

cat /opt/yams/docker-compose.yaml

And you should get some output. If you see something similar to this file then you can use the same command!

If you installed YAMS in another install location, then you should replace it with that.
Example: If you installed YAMS in /home/proto/yams, then your docker-compose file is in /home/proto/yams/docker-compose.yaml, so your command would look like this:

Code: Select all

sed -i -e "s|<filename>|/home/proto/yams/docker-compose.yaml|g" yams

- sed -i -e "s|<custom_file_filename>|/opt/yams/docker-compose.custom.yaml|g" yams

This one is a little different. Since docker-compose.custom.yaml doesn't exist yet on the install location, you can't confirm with curl like before.

So again, if you installed YAMS in the default install location, then the command should be ready to go! If not, you need to replace only the /opt/yams/ part with your correct install location.

Example: If you installed YAMS in /home/proto/yams, then you need to replace /opt/yams/ with /home/proto/yams/, so the command would look like this:

Code: Select all

sed -i -e "s|<custom_file_filename>|/home/proto/yams/docker-compose.custom.yaml|g" yams

- sed -i -e "s|<install_location>|/opt/yams|g" yams

This one is more straightforward. Again, if you installed YAMS in the default install location, then the command should be ready to go! If not, you need to replace /opt/yams/ with your correct install location.

Example: If you installed YAMS in /home/proto/yams, then you need to replace /opt/yams with /home/proto/yams/, so the command would look like this:

Code: Select all

sed -i -e "s|<install_location>|/home/proto/yams|g" yams

And that's it! If you have any other question, let me know!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
Proto
Posts: 4
Joined: Mon Oct 30, 2023 3:47 pm
Gender:
Wales

Re: Unsure what to do regarding YAMS binary

Post by Proto »

Firstly thanks for replying. Your explanations were very helpful! :D
I have used the default install path of /opt/yams/ which was confirmed by running the command to bring up the docker compose file in the terminal.

However there does seem to be an issue. I was initially running the command in the yams-upgrade directory created as part of the tutorial so i changed directories to the default one and then it seems to give an error message 'sed: couldn't edit yams: not a regular file'. I have checked the yams folder in opt and no new files have appeared if that's whats meant to happen. Attached a screenshot to show what i am seeing. Is it a permissions problem from when i first set up YAMS.
Image

User avatar
rogs
Site Admin
Posts: 167
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: Unsure what to do regarding YAMS binary

Post by rogs »

I'm glad you found my explanations useful!

Also, you where in the right place! Everything needs to be run in the~/yams-upgrade directory.

Just so you understand what's going on in that command, you are replacing some text in the yams file inside the ~/yams-upgrade directory, so your error basically says "I can't replace anything because the file 'yams' does not exists".

Do you see how the first command succeeded? You know it succeeded because it didn't return any bad output. That means that the first command (sed -i -e "s|<filename>|/opt/yams/docker-compose.yaml|g" yams) worked as expected :mrgreen:

To continue, just run each of these lines one at a time:

Code: Select all

cd ~/yams-upgrade
sed -i -e "s|<custom_file_filename>|/opt/yams/docker-compose.custom.yaml|g" yams # The second command
sed -i -e "s|<install_location>|/opt/yams|g" yams # The third command
YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
Proto
Posts: 4
Joined: Mon Oct 30, 2023 3:47 pm
Gender:
Wales

Re: Unsure what to do regarding YAMS binary

Post by Proto »

Well i do feel a little dumb :oops: I was expecting a prompt to signify something was done lol Thank you so much with your patience I finished through the rest of the update instructions but have encountered an error at the last hurdle. When running the yams update command i got this as a response:
'/home/proto/yams/.env: line 4: Drive: command not found'

I doubled checked the .env file and the path i have set is correct and is the same as i used for YAMS v1
This is the line in question. MEDIA_DIRECTORY=/mnt/Game Drive PS4/media
It is an external drive and as mentioned it was the path i used for YAMSv1 and has been working fine.

What would be the best way to solve this issue?

User avatar
rogs
Site Admin
Posts: 167
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: Unsure what to do regarding YAMS binary

Post by rogs »

Don't feel dumb hehe. We are all learning here!

Now, regarding your error:

Change

Code: Select all

MEDIA_DIRECTORY=/mnt/Game Drive PS4/media

to

Code: Select all

MEDIA_DIRECTORY=/mnt/Game\ Drive\ PS4/media

That should work. If it doesn't, let me know because I might have another fix.

Explanation: You need to escape spaces in order to use them in bash! To escape characters, we use "\"

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
Proto
Posts: 4
Joined: Mon Oct 30, 2023 3:47 pm
Gender:
Wales

Re: Unsure what to do regarding YAMS binary

Post by Proto »

It's working!

So it was the spaces causing issues. I just kind of went Windows brain and was copying the file path like you would get in File Explorer and pasting it into the .env and that it is how it is written out so I just assumed it would work. I know for future troubleshooting.

Thank you so much for the assistance and for explaining thing. It 100% helped me understand what the commands were supposed to do and helped with my understanding of what to look for when running commands. :D

User avatar
rogs
Site Admin
Posts: 167
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: Unsure what to do regarding YAMS binary

Post by rogs »

That's amazing! I'm really glad everything worked out! :mrgreen:

If you have any other questions, just let us know here in the forum! You can also join YAMS on our Matrix Space or Discord Server in case you want to join us for a friendlier, chattier conversation.

I'm marking this issue as solved. Thanks!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
Post Reply