runtime: dotnet: command not found after installing dotnet core 2 on ubuntu linux 16.04

@andremarcondesteixeira opened this issue here: https://github.com/dotnet/core/issues/1012

I followed the steps in https://www.microsoft.com/net/core#linuxubuntu to install dotnet core 2 (dotnet-sdk-2.0.0) in my machine, which has an Ubuntu Linux 16.04.

Tried it 3 times, and certified that I was executing the commands for my distro and that any previous version was uninstalled, but no success.

Expected Behavior: running dotnet in the command line returns me the helper page of dotnet

Actual Behavior: running dotnet in the command line gives an error dotnet: command not found

Also, the docker package on the official site gets me dotnet core version 1.x, and the docker package with the version 2 (sdk) does nothing when I run it.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 23 (7 by maintainers)

Most upvoted comments

You can get into this situation if you install dotnet core 2 without removing dotnet core 1 first.

Some versions of dotnet core 1 installed into /usr/local/bin/, whereas dotnet core 2 installs to /usr/share/.

You can fix this simply by adding a symlink to the new install location:

sudo ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

sudo ln -sf /usr/share/dotnet/dotnet /usr/local/bin/dotnet