If you’re encountering issues installing .NET 6 on Ubuntu 18.04 despite following the official Microsoft installation guide. Here’s a comprehensive guide to help resolve the most common causes of the error:
Make sure your system has the required tools:
sudo apt-get install -y wget apt-transport-https software-properties-common
Sometimes the initial registration fails silently. Re-add it:
wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Sometimes the key isn’t installed correctly:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
If this still fails, try checking the available versions:
apt-cache search dotnet-sdk
Then install a version that shows up in your list:
sudo apt-get install -y dotnet-sdk-6.0
Note: Ubuntu 18.04 support is nearing the end of its lifecycle. Consider upgrading to Ubuntu 20.04+ if issues persist or for longer .NET support compatibility.
If you tried installing via Snap and got:
/snap/dotnet-sdk/79/snap/command-chain/snapcraft-runner: 3: exec: /snap/dotnet-sdk/79/dotnet: not found
This means the snap package is either corrupted or not properly linked. Fix by removing and reinstalling:
sudo snap remove dotnet-sdk
sudo snap install dotnet-sdk –classic
sudo snap alias dotnet-sdk.dotnet dotnet
If issues persist, prefer the APT package method.
After installation, verify the version:
dotnet –version
Work with our skilled .Net developers to accelerate your project and boost its performance.
Copyright © 2025 NioTechOne Software Solution Pvt. Ltd. All Rights Reserved.