clangwindows-subsystem-for-linuxubuntu-22.04

Every clang command (including --version) results in Segmentation fault


So I am doing a completely clean install with sudo apt install clang. Then when I try to verify installation with clang --version, I always get Segmentation fault (core dumped). That's it, there are no other messages of any sort, and the same goes for every command.

I checked that prerequisites (build-essential, xz-utils, curl) and dependecies are indeed installed. I am using wsl. I haven't touched any environment variables. I also do have gcc installed (there never were any problems with it yet).

Have anyone else encountered this (or similar) problem? Any ideas why this might be happening?

(Edit:

wsl -l -v output: * NAME: Ubuntu; STATE: Stopped; Version: 1

wsl --status output: Default Distribution: Ubuntu; Default Version: 1

)


Solution

  • Reinstalling Ubuntu distribution on WSL2 solved the problem, but why exactly had the problem appeared in the first place - no idea.