Can’t Install .NET 10 on Ubuntu via apt? Here’s a Workaround That Actually Works
Source: Dev.to
TL;DR
dotnet-sdk-10.0may not be available viaaptyet, depending on your region.- This is due to APT repository propagation, not a broken setup.
- Microsoft’s official install script is the supported workaround.
- Installing the SDK also installs the runtime.
- You can safely keep .NET 8, 9, and 10 side‑by‑side.
The Problem: apt Can’t Find .NET 10 (Yet)
Even with Microsoft’s Ubuntu repository configured (https://packages.microsoft.com/ubuntu/24.04/prod), the SDK installation fails:
sudo apt-get update
sudo apt-get install dotnet-sdk-10.0
Result:
E: Unable to locate package dotnet-sdk-10.0
Why This Happens
Microsoft rolls out APT packages gradually across mirrors and regions. Consequently:
- Some users can install .NET 10 immediately.
- Others won’t see the package yet.
apt cannot install packages that haven’t reached your mirror. You can check availability with:
apt-cache policy dotnet-sdk-10.0
If it reports “Unable to locate package,” the SDK simply isn’t there yet.
The Workaround: Microsoft’s Official Install Script
Until the APT package reaches your region, use Microsoft’s installer script:
wget https://dot.net/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 10.0
The script installs .NET 10 under $HOME/.dotnet.
Important: Set Environment Variables
After installing via the script, add .NET to your PATH:
# Add to ~/.bashrc or ~/.zshrc
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
Reload the shell:
source ~/.bashrc # or source ~/.zshrc
Verify the Install
dotnet --list-sdks
Expected output (example):
10.0.101 [/home/youruser/.dotnet/sdk]
Side‑by‑Side with .NET 8 and .NET 9
Installing .NET 10 this way does not interfere with existing installations. You can have:
- .NET 8 (installed via
apt) - .NET 9 (installed via
apt) - .NET 10 (installed via the script)
When dotnet-sdk-10.0 becomes available via apt in your region, you can switch back to a fully package‑managed setup.
Final Thoughts
- If
aptcan’t find .NET 10 on Ubuntu 24.04, your system isn’t misconfigured. - The package simply hasn’t propagated to your mirror yet.
- Microsoft’s official install script is safe, supported, and works as a reliable temporary solution.
Once the APT package is available in your region, you can revert to installing .NET 10 via apt.