When you say near do you mean installing near CLI?
Try installing the pre built binaries
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.15.1/near-cli-rs-installer.sh | sh
https://github.com/near/near-cli-rs/releases/tag/v0.15.1