This is a weird error that happens sometimes, I currently have no idea why that happens, but I’ve seen it happen with a few people, here is a workaround:
This seems to happen because sometimes the tarball that we use to get brew installed just doesnt get generated properly and the brew setup service puts the homebrew files on the wrong place. This should move them to the right place.
I’m not sure how related this may be but I had a similar error in a recent Bazzite install on a system. I blew past the admin config during the install and set up a new admin and it didn’t have access to some of the built in functions like brew and ujust commands. It was a fresh install so I just booted via usb and installed over that copy while setting up an admin profile during the install and that fixed the odd group/permission issues I was having.
pbeccard@rubicon:~$ pkexec mkdir -p /var/home/linuxbrew/.linuxbrew
pbeccard@rubicon:~$ pkexec mv /var/home/linuxbrew/* /var/home/linuxbrew/.linuxbrew
/usr/bin/mv: der Aufruf von stat für '/var/home/linuxbrew/*' ist nicht möglich: Datei oder Verzeichnis nicht gefunden