• ubuntu下.NET Core手动更换版本(卸载再安装)


    原环境

    .NET Core SDK(反映任何 global.json):
     Version:   2.2.110
     Commit:    4797dabd3c
    
    运行时环境:
     OS Name:     Windows
     OS Version:  6.1.7601
     OS Platform: Windows
     RID:         win7-x64
     Base Path:   C:Program Filesdotnetsdk2.2.110
    
    Host (useful for support):
      Version: 2.2.8
      Commit:  b9aa1abc51
    
    .NET Core SDKs installed:
      2.1.522 [C:Program Filesdotnetsdk]
      2.2.110 [C:Program Filesdotnetsdk]
    
    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.1.26 [C:Program FilesdotnetsharedMicrosoft.AspN
    etCore.All]
      Microsoft.AspNetCore.All 2.2.8 [C:Program FilesdotnetsharedMicrosoft.AspNe
    tCore.All]
      Microsoft.AspNetCore.App 2.1.26 [C:Program FilesdotnetsharedMicrosoft.AspN
    etCore.App]
      Microsoft.AspNetCore.App 2.2.8 [C:Program FilesdotnetsharedMicrosoft.AspNe
    tCore.App]
      Microsoft.NETCore.App 2.1.26 [C:Program FilesdotnetsharedMicrosoft.NETCore
    .App]
      Microsoft.NETCore.App 2.2.8 [C:Program FilesdotnetsharedMicrosoft.NETCore.
    App]
    
    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download

    现环境

    root@servercore:~# dotnet --info
    .NET Core SDK (reflecting any global.json):
     Version:   2.2.402
     Commit:    c7f2f96116
    
    Runtime Environment:
     OS Name:     ubuntu
     OS Version:  18.04
     OS Platform: Linux
     RID:         ubuntu.18.04-x64
     Base Path:   /usr/share/dotnet/sdk/2.2.402/
    
    Host (useful for support):
      Version: 2.2.8
      Commit:  b9aa1abc51
    
    .NET Core SDKs installed:
      2.2.402 [/usr/share/dotnet/sdk]
    
    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    
    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download

    当然sdk使用2.2.108比2.2.110可能要稳一点,微软官方开发环境的最佳sdk版本图:

    OSDevelopment Environment.NET Core SDK
    Any supported Command line and/or Visual Studio Code 2.2.401
    Windows Visual Studio 2019 version 16.2 2.2.401
    Windows Visual Studio 2019 version 16.1 2.2.301
    Windows Visual Studio 2019 version 16.0 2.2.205
    Windows Visual Studio 2017 2.2.108

    二,验证过程

    1.卸载(参照:微软文档):

    dpkg --list  #查看安装的包
    #apt-get remove 要删除的包
    apt-get remove dotnet-host
    apt-get remove dotnet-hostfxr
    apt-get remove dotnet-runtime
    apt-get remove dotnet-sdk-2.2

    2.安装:

    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
    sudo apt-get install apt-transport-https
    sudo apt-get update
    sudo apt-get install dotnet-sdk-2.2=2.2.110-1
    #sudo apt-get install dotnet-sdk-2.2=2.2.108-1

    3.查看修改完的环境:

    .NET Core SDK (reflecting any global.json):
     Version:   2.2.110
     Commit:    4797dabd3c
    
    Runtime Environment:
     OS Name:     ubuntu
     OS Version:  18.04
     OS Platform: Linux
     RID:         ubuntu.18.04-x64
     Base Path:   /usr/share/dotnet/sdk/2.2.110/
    
    Host (useful for support):
      Version: 2.2.8
      Commit:  b9aa1abc51
    
    .NET Core SDKs installed:
      2.2.110 [/usr/share/dotnet/sdk]
    
    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    
    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download

      OK,修改完毕。

    365个夜晚,我希望做到两天更一篇博客。加油,小白!
  • 相关阅读:
    Activiti7 历史任务实例查询
    在springboot中开启Activiti的SQL日志
    SpringMvc接收日期参数
    Intellij IDEA 的Run Configuration配置VM options参数
    <el-input>点击事件
    Vue自定义组件中Props类型为数组或对象
    bpmn-js画流程图 (四)右侧属性面板中执行人,候选人与候选组可以通过 用户、机构(角色)选择
    外部js调用vue的方法
    vue-cli4 取消关闭eslint 校验代码
    bpmn-js画流程图 (三)隐藏右下角的绿色logo
  • 原文地址:https://www.cnblogs.com/qq2806933146xiaobai/p/14661936.html
Copyright © 2020-2023  润新知