#How do I install the zig compiler on Linux?

1 messages · Page 1 of 1 (latest)

jolly hedge
#

Which theses do I install?

#

My OS is PopOS

ocean rain
#

probably the first one

#

zig-linux-x86_64

#

uname -a would tell you

#

then you can put export PATH=$PATH:~/zig (or wherever you installed zig) in your ~/.profile

#

then you could log out and log in (or just to test it, run source ~/.profile and then see if zig works)

jolly hedge
#

ok

#

i'll test

#

@ocean rain

#

what now?

ocean rain
#

unzip it

#

(or really untar it)

#

the file manager should have an option

jolly hedge
#

Ok

#

Yeaaah

#

I unzip it now

#

What I do?

ocean rain
#

good, now move the whole upper directory (not doc or lib, but the one containing them) to a spot you want

#

export PATH=$PATH:where you moved it <- run this in the terminal after

jolly hedge
#

Where could it be placed?

ocean rain
#

~/.local/zig could work

#

really anywhere

shut stag
jolly hedge
ocean rain
#

it depends on personal preference I like ~/.local/zig, but you might just want ~/zig to make it easy

jolly hedge
#

I don't understand

#

Where do I run it?

ocean rain
#

in the terminal

#

export PATH=$PATH:where you moved it

#

run that

jolly hedge
#

I know

ocean rain
#

then zig should work in the terminal

jolly hedge
ocean rain
#

can you do echo $PATH?

#

and tell me where you moved it to?

jolly hedge
#

yes

ocean rain
#

did you run that yet?

jolly hedge
#

yes

ocean rain
#

can you echo $PATH?

jolly hedge
#

YES, DUDE

shut stag
#

maybe ```bash
chmod +x ~/.local/zig/zig

(to add executable flag to file (to show the system that the file is ok to run))
jolly hedge
#

wtf?

ocean rain
#

are you sure you moved the whole directory to ~/.local/zig?

jolly hedge
#

I still run the comand

shut stag
#

🤣

jolly hedge
ocean rain
#

ok, so your problem is that you didn't move the zig directory to ~/.local/zig

jolly hedge
#

Ok, dude

shut stag
jolly hedge
#

But how can I do it?

ocean rain
#

in the terminal, run mv {where it was previously} ~/.local/zig

jolly hedge
#

???????????//

#

WTF MAN

shut stag
jolly hedge
ocean rain
#

is zig a file or a folder?

jolly hedge
#

folder

ocean rain
#

hm, then chmod +x ~/.local/zig/zig should work

#

can you do ls -la ~/.local/zig?

jolly hedge
#

YES

ocean rain
#

perfect

#

could you run ~/.local/zig/zig in the terminal? it should work now

jolly hedge
#

YEEEEEEEEEEEAH

ocean rain
#

great

jolly hedge
ocean rain
#

the problem may be with the ~ in the PATH

#

instead of ~, you can replace it with your home directory. for me it's /home/jacob/.local/zig

#

that might fix it

jolly hedge
#

what's the command?

ocean rain
#

export PATH=$PATH:/home/YOU/.local/zig

jolly hedge
#

great

shut stag
jolly hedge
#

😦

#

I'm sorry

ocean rain
#

did you run the path thing in your terminal?

jolly hedge
#

sim

#

Zig is too boring to download :/

ocean rain
#

:/

#

one last thing to try: export PATH="/home/YOU/.local/zig:$PATH"

shut stag
#

I don't think he moved the folder...

ocean rain
#

🥲

#

desculpame

jolly hedge
#

...

#

zig is very bad, bro

shut stag
#

show the contents of the folder ~/.local/zig

austere plume
#

the YOU

#

i'm 100% sure

#

@jolly hedge what is your linux user

#

ok it's migueloliveira

shut stag
austere plume
#

maybe he didn't try that

jolly hedge
#

guys

#

i try that

#

I achieved

#

i put it on usr/bin

#

@shut stag

shut stag
jolly hedge
shut stag
#

did you copy the whole folder there?

jolly hedge
#

no

#

Only the file executable

#

zig

shut stag
#

#1127234696070311966 message

jolly hedge
#

Does this have a problem?

shut stag
#

Of course, I immediately guessed that he was a troll, but still I hoped ...

jolly hedge
#

@shut stag It's all ok?

shut stag
#

if you is still not a troll - this is a visual aid not to use PopOS

jolly hedge
#

ok