Skip to content

Instantly share code, notes, and snippets.

@Carl-Hugo
Last active September 15, 2020 01:19
Show Gist options
  • Save Carl-Hugo/f91a4792b4e86d130bdc7a104f676d0b to your computer and use it in GitHub Desktop.
Save Carl-Hugo/f91a4792b4e86d130bdc7a104f676d0b to your computer and use it in GitHub Desktop.
Ubuntu .Net Core SDK snippets

Ubuntu .Net Core SDK snippets

Uninstall all .Net Core SDK

sudo apt remove dotnet-host

Fix Packages were downgraded and -y was used without --allow-downgrades

sudo apt remove netstandard-targeting-pack-2.1

Install official releases

sudo apt-get install -y dotnet-sdk-2.1
sudo apt-get install -y dotnet-sdk-3.1

Download and install a preview release (a.k.a. .Net 5)

  1. Create and cd into the directory to download the SDK in
    mkdir $HOME/dotnet_install && cd $HOME/dotnet_install
  2. Download the install script:
    curl -H 'Cache-Control: no-cache' -L https://aka.ms/install-dotnet-preview -o install-dotnet-preview.sh
    # or "bypass" aka.ms download it directly from the blob storage
    curl -H 'Cache-Control: no-cache' -L https://dotnetcli.blob.core.windows.net/dotnet/release/install-preview/install-dotnet-preview.sh -o install-dotnet-preview.sh
  3. Install that preview version
    sudo bash install-dotnet-preview.sh

Taken from: https://github.com/dotnet/core/blob/master/release-notes/5.0/preview/5.0.0-preview.6-install-instructions.md

Install previous preview

To install previous preview, before executing the install-dotnet-preview.sh, edit the file and change the following variables:

  • DEPS_BUILD
  • PREVIEW_NUMBER

For example, preview 5 would be:

  • DEPS_BUILD="20279.10"
  • PREVIEW_NUMBER="5"

While preview 6 is:

  • DEPS_BUILD="20305.6"
  • PREVIEW_NUMBER="6"

With the VS Code WSL extension, you can code . from the $HOME/dotnet_install directory in WSL to open VS Code.

Those values are available on the download page, and look at the Full version: Download .NET 5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment