I am trying to set up side-by-side installations of .NET SDK versions on Linux Mint 21.3. Currently, I have installed:
- .NET SDK 9.0.201 (located in
/usr/share/dotnet-sdk-9.0.201/
) - .NET SDK 8.0.407 (located in
/usr/share/dotnet-sdk-8.0.407/
)
I set up my environment variables in /etc/profile.d/dotnet.sh
:
export DOTNET_MULTILEVEL_LOOKUP=0
export PATH=/usr/share/dotnet-sdk-9.0.201:/usr/share/dotnet-sdk-8.0.407:$PATH
export DOTNET_ROOT=/usr/share/dotnet-sdk-8.0.407
However, when I run dotnet --info
, it only detects .NET 9:
.NET SDK:
Version: 9.0.201
Commit: 071aaccdc2
Workload version: 9.0.200-manifests.21502d11
MSBuild version: 17.13.13+1c2026462
I have verified that .NET 8 is extracted correctly:
ls -l /usr/share/dotnet-sdk-8.0.407/
I also tried manually running:
/usr/share/dotnet-sdk-8.0.407/dotnet --info
and it correctly shows .NET 8. But the global dotnet --info
does not list it.
I've tried:
Updating
/etc/profile.d/dotnet.sh
and reloading with source/etc/profile.d/dotnet.sh
Manually setting
DOTNET_ROOT=/usr/share/dotnet-sdk-8.0.407
before runningdotnet --info
Checking if
/usr/local/bin/dotnet
is pointing to the wrong locationRunning
dotnet --list-sdks
, which only shows version 9
How can I properly configure my environment so that both .NET SDK versions are available and dotnet --list-sdks
recognizes both?