"rustc --version" needs sudo

Hi all!

When I enter “rustc --version” I get following
cmd_run.go:1046: WARNING: cannot create user data directory: cannot create “/home/#user#/snap/rustup/common”: mkdir /home/#user#/snap/rustup/common: permission denied
cannot create user data directory: /home/#user#/snap/rustup/1026: Not a directory
When I enter “sudo rustc --version” I get “rustc 1.66.1 (90743e729 2023-01-10)”

What to do that sudo is not neede here any longer?


Have you installed rustup via snap? Why not just use the rust package in the repositories?

1 Like

Snaps and FlatPaks are containerized applications. They do not have access to the whole underlying filesystem.

I think now also this would have been the better way!
How to fix this? Run deinstall from the snap folder and update path var?

I would probably remove all toolchains from rustup first, then uninstall all rust related packages from snap, and then install the rust package from the repository (and maybe rustup if you need that - from the repository).