PROWAREtech








How to Remove and Reinstall .NET on Linux (Ubuntu)
First, remove all the existing packages and restore the system to a clean state by issuing these three commands.
Attempt to remove this file (should it exist):
Issue the following two commands to use the official ubuntu package.
Note that this example uses .NET 8 but later versions can be specified for the future. If a version of the SDK was just released then Ubuntu may not have updated their repository with the latest version; using the Ubuntu Software app to install the .NET SDK is not recommended.
If the above command does not work, try these three commands replacing the 22.04 with the Ubuntu version being used:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
Then issue this command replacing the sdk version with the latest version available:
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
Now, issue this command to see if .NET is working properly.