.NET Core notes

Install .NET Core runtimes or SDKs

Download .NET

Ubuntu 18.04

  1. Register Microsoft Key and feed

    wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
  2. Update product available for installation

    sudo add-apt-repository universe
    sudo apt-get install apt-transport-https
  3. Install .NET Core SDK

    sudo apt update
    apt-cache search dotnet
    sudo apt install dotnet-dev-1.1.11
    sudo apt install dotnet-dev-1.1.13
    sudo apt install dotnet-sdk-2.1
    sudo apt install dotnet-sdk-2.2
    sudo apt install dotnet-sdk-3.0
  4. Install .NET Core Runtime

    sudo apt update
    apt-cache search dotnet
    sudo apt install aspnetcore-runtime-2.1
    sudo apt install aspnetcore-runtime-2.2
    sudo apt install aspnetcore-runtime-3.0
  5. Check everything installed correctly

    dotnet
    dotnet --help
    dotnet --info
    dotnet --version
    dotnet --list-sdks
    dotnet --list-runtimes

dpkg note:

# install package
dpkg -i packages-microsoft-prod

# uninstall package except config file
dpkg -r packages-microsoft-prod

# uninstall package including config file
dpkg -P packages-microsoft-prod

# list installed packages with version and description
dpkg -l packages-microsoft-prod

Uninstall .NET Core runtimes or SDKs

.NET Core uninstall scripts

How to remove the .NET Core Runtime and SDK

Ubuntu 18.04

# uninstall script
curl -OL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh
chmod u+x dotnet-uninstall-debian-packages.sh
sudo ./dotnet-uninstall-debian-packages.sh

# remove remaining folders
sudo rm -rf /usr/share/dotnet
sudo rm -rf ~/.dotnet

# uninstall package including config file
dpkg -P packages-microsoft-prod
sudo apt update

macOS

# uninstall script
curl -OL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh
chmod u+x dotnet-uninstall-pkgs.sh
sudo ./dotnet-uninstall-pkgs.sh

# remove remaining folders
sudo rm -rf /usr/share/dotnet
sudo rm -rf ~/.dotnet

© 2020 | Paul Kim