#Recommended way to install Zig on Linux Ubuntu ?

1 messages · Page 1 of 1 (latest)

frozen cave
#

Hello, can someone confirm that the best way to install Zig for Linux Ubuntu is via the package manager called 'snap' ?

gloomy oracle
shy shoal
#

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

gloomy oracle
shy shoal
#

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

frozen cave
#

I would want to download it but I couldn't get it to work with installation commands

#

If downloading zig through snap is fine, I'll keep it like that

frozen cave
shy shoal
frozen cave
shy shoal
# frozen cave 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

frozen cave
#

Oh, I'm lost
I'll stick to snap
Thank you for trying to help me

shy shoal
#

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

gloomy oracle
frozen cave
#

Adding the zig command to path was where I failed

#

snap seems to have worked