Install .NET 7 on Ubuntu using Snap

sudo snap install dotnet-sdk --classic --channel=7.0
sudo snap alias dotnet-sdk.dotnet dotnet

You can edit your shell profile to permanently add the commands.

Bash Shell: ~/.bash_profile, ~/.bashrc

export DOTNET_ROOT=/snap/dotnet-sdk/current

References
https://learn.microsoft.com/en-us/dotnet/core/install/linux-snap
https://stackoverflow.com/questions/68519558/how-to-fix-segmentation-fault-core-dumped-when-creating-new-dotnet-project