#I don't understand why I'm failing at symlink the odin binary on Linux Mint

34 messages · Page 1 of 1 (latest)

median tinsel
#

That command will add a line to ~/.bashrc file that will overwrite your PATH variable to contain only /odin-linux-amd64-dev-2024-10. That won't take effect until the next time you start a Bash session (e.g. open a new terminal), but is also probably not what you want, as PATH may contain other directories too

#

Yeah, that's why you shouldn't overwrite your PATH

#

Open ~/.bashrc in a text editor and remove those lines from the end

#

You should still be able to run vim, nano, etc. by specifying their whole path (probably in /usr/bin) if you need to

#

Or, a GUI editor should also work fine

#

Now, the difference is that you want to add onto PATH. Usually, you'd do that with a line something like:

PATH=$PATH:/odin-linux-amd64-dev-2024-10
#

That'll add the directory you want without removing what's already there

#

Once that's added, then you should be able to open a new terminal and Odin should work without breaking all of your normal system commands

#

Now as for the Permission Denied error, you probably just need to check the actual permissions. It's in your root directory, so I'm guessing you created it using sudo? It probably doesn't have permissions for any user to use

#

A simple fix would be to use sudo chmod -R o+rX /odin-linux-amd64-dev-2024-10 to make the directory and all of its files readable. and then sudo chmod o+x /odin-linux-amd64-dev-2024-10/odin to make the Odin compiler itself executable

#

-# as an aside: the correct location to put the odin directory would be in /opt, not in the root, but that won't affect whether it works or not. just a matter of the "normal" filesystem organization; usually things would be installed so their files are distributed into /bin, /lib, etc. but /opt is for self-contained packages

#

echo $PATH?

#

Right, the Odin directory didn't get added to the PATH

median tinsel
#

You missed a step in the instructions, or rather misread it... the original command has :$PATH at the end, which would have stopped it from overwriting your PATH in the first place

#

You can do it that way too, but adding it to the file manually also works. The command is just a one-off command to do it

#

So let's do it this way, then. The command you wanted to run in the first place is:

echo 'export PATH="/odin-linux-amd64-dev-2024-10:$PATH"' >> ~/.bashrc
#

That should still work, but you missed the :$PATH which is actually kind of important for not breaking things

#

So run that, open a new terminal, and try it again and make sure things are working

#

Can you show your .bashrc file, then?

#

echo $PATH again? Does it have the Odin directory in it now?

#

It should actually be in there 3 times, which isn't great but shouldn't stop it from working

#

OK, it's there. So you're back to persmission denied, then, I'm guessing?

median tinsel
#

That could still be from the permissions not being set. It's definitely in PATH now

#

stat /odin-linux-amd64-dev-2024-10/odin if it's still not working

#

Wait, hang on then. Where is your Odin directory?

#

The full path, that is

#

Your original command made it look like it was in the root directory, but that doesn't look like it's the case

#

Ah, the ~ is important

#

That means it's in your home directory. Edit your .bashrc to correct it in that export PATH= command at the end of the file (and remove the duplicates while you're there)

#

You may not need to worry about permissions, then, it's actually in your home directory, so they may already be fine

#

\o/

#

There you go