I am using dotnet6 in my ubuntu 22.04 version. Right now when I run dotnet --version, I am getting the below error.
jyothish@jyothish-Lenovo-G570:~$ 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
jyothish@jyothish-Lenovo-G570:~$
At the same time when I run dotnet --help and dotnet --list-runtimes, I am getting output.
jyothish@jyothish-Lenovo-G570:~$ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]
jyothish@jyothish-Lenovo-G570:~$ dotnet --help
Usage: dotnet [host-options] [path-to-application]
path-to-application:
The path to an application .dll file to execute.
host-options:
--additionalprobingpath <path> Path containing probing policy and assemblies to probe for.
--depsfile <path> Path to <application>.deps.json file.
--runtimeconfig <path> Path to <application>.runtimeconfig.json file.
--fx-version <version> Version of the installed Shared Framework to use to run the application.
--roll-forward <value> Roll forward to framework version (LatestPatch, Minor, LatestMinor, Major, LatestMajor, Disable)
--additional-deps <path> Path to additional deps.json file.
--list-runtimes Display the installed runtimes
--list-sdks Display the installed SDKs
Common Options:
-h|--help Displays this help.
--info Display .NET information.
jyothish@jyothish-Lenovo-G570:~
How can I correct this and resume using dotnet6 in ubuntu?