#Recommended way to install Zig on Linux Ubuntu ?
1 messages · Page 1 of 1 (latest)
not sure how to answer, but snap is the recommended way when using a system package manager according to https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager
Since zig is static binsry, can also download from official website and just use it directly
if pkg manager has fresh enough zig, can just use that too
i personally use zigup https://github.com/marler8997/zigup which is nice for managing multiple zig versions
Problem with zig is that it updates often and if you want newest features, you'll somehow need to keep up to date with master branch. Package managers typically lag behind
I would want to download it but I couldn't get it to work with installation commands
I tried Direct Download and setting up Path on Linux
from here : https://ziglang.org/learn/getting-started/
If downloading zig through snap is fine, I'll keep it like that
Yes, I did that
Although I've been told snap sometimes mess up language installation, like for Go (golang)
should be as simple as download, unpack and ./zig in the directory where you unpacked it. To have it work anywhere, use PATH
What does " ./zig in the directory " mean ?
in linux shell, any file with executable flag can be executed by specifying an absolute or relative path to it. In this case zig binary is a file with executable flag. ./ starts a reative file path where . is magical symbol representing the current directory, thus ./zig refers to a file called "zig" in the current directory
Oh, I'm lost
I'll stick to snap
Thank you for trying to help me
in fact every command is actually a binary file in linux. Even snap you used. You can use command which snap to find the full path to the executable. The reason why snap can be used in any directory is because the directory the snap executable is in, is listed in special environment variable PATH. If you check echo $PATH, you'll discover list of directories that contain binary files that can be used as shell commands
To navigate the directories you have the cd command, to check current directtory there is pwd. To see the contents of current directory there is ls
this means 'run zig'. if a file is executable it can be run with ./file