Installing preview .NET SDK in Arch Linux
I'm in the process of switching from Windows 11 to CachyOS on my home machine. Of course, my setup also includes .NET development tooling. And with the upcoming .NET 11 release, I want to have access to its latest preview as well. However, the installation initially failed because the dotnet-sdk-preview-bin package from the user repository was in conflict with the dotnet-sdk-10.0 package from the official repository I already had installed.
Fortunately, there's a detailed .NET page in Arch Linux Wiki which proved very helpful for resolving my issue. According to it, I could choose between two approaches to get the .NET 11 SDK preview installed:
- do it manually using the dotnet-install script, or
- use user repository packages exclusively for installing .NET.
I chose the second approach. I first uninstalled the dotnet-sdk-10.0 package and started experimenting with AUR packages to get everything working. Even after reading the documentation, it took me a few tries before I succeeded.
In the end, I learned the following:
- I need to have either
dotnet-host-binordotnet-host-preview-binpackage installed. The former only works with stable versiosn, so the latter is required to be able to also install the preview versions. - For each SDK version, three packages have to be installed:
dotnet-sdk-bin,dotnet-runtime-binandaspnet-runtime-bin. These three install the latest stable release, i.e., .NET 10 at the time of writing. The preview version addspreviewto the package names (e.g.,dotnet-sdk-preview-bin) and the older stable versions add their version number to the package names (e.g.,dotnet-sdk-9.0-binfor .NET 9).
This meant that to install the SDKs for the preview version and all still supported stable versions, I had to install the following packages:
- common host package:
dotnet-host-preview-bin - .NET 11 SDK preview:
dotnet-sdk-preview-bin,dotnet-runtime-preview-bin,aspnet-runtime-preview-bin - .NET 10 SDK:
dotnet-sdk-bin,dotnet-runtime-bin,aspnet-runtime-bin - .NET 9 SDK:
dotnet-sdk-9.0-bin,dotnet-runtime-9.0-bin,aspnet-runtime-9.0-bin - .NET 8 SDK:
dotnet-sdk-8.0-bin,dotnet-runtime-8.0-bin,aspnet-runtime-8.0-bin
After installing all the packages listed above, I ended up with the following SDKs on my machine:
❯ dotnet --list-sdks
8.0.423 [/usr/share/dotnet/sdk]
9.0.316 [/usr/share/dotnet/sdk]
10.0.301 [/usr/share/dotnet/sdk]
11.0.100-preview.6.26359.118 [/usr/share/dotnet/sdk]
I assume that by simply updating the already installed packages, these SDKs should be updated to their respective latest versions. I expect that I'll only have to install additional packages when .NET 11 gets released because dotnet-sdk-bin will then install .NET 11 instead and I'll have to install dotnet-sdk-10.0-bin for .NET 10.
I might also uninstall the preview packages altogether at that time since I won't be all that interested in .NET 12 until a few months before release. And of course, I'll eventually uninstall .NET 8 and .NET 9 after they aren't supported anymore.
