I'm trying to install the .NET SDK on my Ubuntu 22.04 system, but I'm running into some issues. After following the installation steps, I can't seem to find the SDK anywhere on my system. Here's what I've done so far:
- I removed any existing .NET packages with the following command:
sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
This seemed to remove the existing .NET SDK 7.0 and other related packages.
- I then checked if the SDK was removed:
ls /usr/lib/dotnet/dotnet
ls /usr/lib/dotnet/
Both commands confirmed that the SDK was not present.
- Finally, I tried to reinstall the SDK:
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-7.0
The installation seemed to go smoothly, but when I checked again, the SDK was still not found.
dotnet --list-sdks shows nothing, dotnet --help works and shows the help menu. dotnet --version gives this message:
dotnet --version
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application '--version' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet/download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
list runtimes worked:
dotnet --list-runtimes
Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
And the directories were rebuilt:
ls /usr/lib/dotnet/
dotnet host LICENSE.txt packs shared ThirdPartyNotices.txt
ls /usr/lib/dotnet/dotnet
/usr/lib/dotnet/dotnet
ls /usr/lib/dotnet/shared
Microsoft.AspNetCore.App Microsoft.NETCore.App
I'm not sure what I'm missing here. Why is the SDK not showing up after installation? Any help would be greatly appreciated.
Here is my release:
lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description: Pop!_OS 22.04 LTS
Release: 22.04
Codename: jammy
To find the SDK I ran
Then I looked into the directories shown in the response. I found the SDK in
/usr/share/dotnet.Next, I found the dotnet executable with:
/usr/bin/dotnetended up being a symbolic link to/lib/dotnet/dotnet.Since dotnet executable was in a different location than the SDK, I made a new symbolic link of the SDK diriectory and placed it in the
/lib/dotnetdirectoryNow
dotnet --list-sdksworks correctly:Finally, I was able to use
dotnet runto start my application.