19

I've install .NET Core on my Ubuntu 18.04 using sudo snap install dotnet-sdk --classic, but after the install process complete, the dotnet command still not working. Here is my console log:

long@long-ub1804:~$ sudo snap install dotnet-sdk
[sudo] password for long: 
error: This revision of snap "dotnet-sdk" was published using classic
       confinement and thus may perform arbitrary system changes outside of the
       security sandbox that snaps are usually confined to, which may put your
       system at risk.

       If you understand and want to proceed repeat the command including
       --classic.
long@long-ub1804:~$ sudo snap install dotnet-sdk --classic
dotnet-sdk 2.2.202 from Microsoft .NET Core (dotnetcore✓) installed
long@long-ub1804:~$ dotnet --version

Command 'dotnet' not found, but can be installed with:

sudo snap install dotnet-sdk

long@long-ub1804:~$ snap list
Name                  Version                    Rev   Tracking  Publisher    Notes
chromium              73.0.3683.86               669   stable    canonical✓   -
core                  16-2.38                    6673  stable    canonical✓   core
core18                18                         782   stable    canonical✓   base
docker                18.06.1-ce                 321   stable    canonical✓   -
dotnet-sdk            2.2.202                    32    stable    dotnetcore✓  classic
gnome-3-26-1604       3.26.0.20190228            82    stable/…  canonical✓   -
gnome-3-28-1804       3.28.0-9-gce87599.ce87599  23    stable    canonical✓   -
gnome-calculator      3.32.0+git2.cae338ea       352   stable/…  canonical✓   -
gnome-characters      v3.32.0+git1.9ff74a2       206   stable/…  canonical✓   -
gnome-logs            3.32.0                     57    stable/…  canonical✓   -
gnome-system-monitor  3.32.0                     70    stable/…  canonical✓   -
gtk-common-themes     0.1-16-g2287c87            1198  stable/…  canonical✓   -
pycharm-community     2019.1.1                   123   stable    jetbrains✓   classic
long@long-ub1804:~$ 

1
  • 1
    Run the app as dotnet-sdk.dotnet from the command line.
    – Terrance
    Apr 7, 2019 at 14:44

1 Answer 1

36

You should try the following command

sudo snap alias dotnet-sdk.dotnet dotnet

Since snap doesn't provide automatic aliases for dotnet-sdk.

Regards,

4
  • 8
    Package managers come and go, some stick for long, some not so much. Their consistency, however, in eventually failing in the most basic tasks is remarkable. Thanks for the tip. Nov 12, 2019 at 13:52
  • 3
    I have heard mention that there will still be issues with visual studio code without a bit of additional configuration? Jan 6, 2020 at 6:01
  • 3
    Don't use snap to install dotnet. It only half works and vs code won't work. Also getting rid of it is a pain
    – Calanus
    Mar 15, 2020 at 12:09
  • 3
    And also don't use Ubuntu Software Updater to update dotnet, because it'll use snap, and you'll get to waste a day like I just did
    – JBSnorro
    Jun 10, 2020 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.