oracle.net sdk,删除 .NET 运行时和 SDK | Microsoft Docs-程序员宅基地

技术标签: oracle.net sdk  

如何删除 .NET 运行时和 SDKHow to remove the .NET Runtime and SDK

03/02/2021

本文内容

经过一段时间后,在安装 .NET 运行时和 SDK 的更新版本时,你可能需要从计算机中删除过时的 .NET 版本。Over time, as you install updated versions of the .NET runtime and SDK, you may want to remove outdated versions of .NET from your machine. 如 .NET 版本选择一文中详述,删除旧版运行时可能会更改为运行共享框架应用程序所选择的运行时。Removing older versions of the runtime may change the runtime chosen to run shared framework applications, as detailed in the article on .NET version selection.

是否应删除某个版本?Should I remove a version?

借助 .NET 版本选择行为和 .NET 各个更新之间的运行时兼容性,可安全地删除以前的版本。The .NET version selection behaviors and the runtime compatibility of .NET across updates enables safe removal of previous versions. .NET 运行时更新在主版本“区段”(如 1.x 和 2.x)中兼容。.NET runtime updates are compatible within a major version band such as 1.x and 2.x. 此外,较新版本的 .NET SDK 通常能够兼容地生成面向运行时早期版本的应用程序。Additionally, newer releases of the .NET SDK generally maintain the ability to build applications that target previous versions of the runtime in a compatible manner.

通常,只需要应用程序所需的最新 SDK 和运行时的最新补丁版本。In general, you only need the latest SDK and latest patch version of the runtimes required for your application. 需要保留旧版 SDK 或运行时版本的实例包括维护基于 project.json 的应用程序 。Instances where you might want to keep older SDK or runtime versions include maintaining project.json-based applications. 除非应用程序有需保留早期 SDK 或运行时的特定原因,否则可以安全地删除旧版本。Unless your application has specific reasons for earlier SDKs or runtimes, you may safely remove older versions.

确定安装内容Determine what is installed

.NET CLI 提供了相关的选项,你可以使用它们来列出计算机上安装的 SDK 和运行时。The .NET CLI has options you can use to list the versions of the SDK and runtime that are installed on your machine. 使用 dotnet --list-sdks 查看计算机上安装的 SDK 列表。Use dotnet --list-sdks to see the list of SDKs installed on your machine. Use dotnet --list-runtimes to see the list of runtimes installed on your machine.

卸载 .NETUninstall .NET

.NET 使用 Windows“应用和功能”对话框来删除各版 .NET 运行时和 SDK。.NET uses the Windows Apps & features dialog to remove versions of the .NET runtime and SDK. 下图显示了“应用和功能”对话框 。The following figure shows the Apps & features dialog. 你可以搜索 core sdk 或 .net sdk 来筛选和显示安装的 .NET 版本 。You can search for core sdk or .net sdk to filter and show installed versions of .NET.

367f4da121c99e5e75a6e6fde8d98a04.png

选择要从计算机中删除的任何版本,然后单击“卸载” 。Select any versions you want to remove from your machine and click Uninstall.

Linux 还提供其他选项来卸载 .NET(SDK 或运行时)。There are more options to uninstall .NET (either SDK or runtime) on Linux. 卸载 .NET 的最佳方法是镜像用来安装 .NET 的操作。The best way for you to uninstall .NET is to mirror the action you used to install .NET. 具体取决于所选择的分发和安装方法。The specifics depend on your chosen distribution and the installation method.

重要

For Red Hat installations, consult the Red Hat Product Documentation for .NET.

除非从预览版本进行升级,否则使用包管理器升级时无需卸载 .NET SDK。There's no need to uninstall the .NET SDK when upgrading it using a package manager, unless you're upgrading from a preview version. 包管理器 update 或 refresh 命令将在成功安装较新版本后自动删除旧版本。The package manager update or refresh commands will automatically remove the older version upon the successful installation of a newer version. 如果已安装预览版本,请卸载该版本。If you have a preview version installed, uninstall it.

如果使用包管理器安装 .NET,则使用同一包管理器来卸载 .NET SDK 或运行时。If you installed .NET using a package manager, use that same package manager to uninstall the .NET SDK or runtime. .NET 安装支持常用的包管理器。.NET installations support most popular package managers. 有关环境中的精确语法,请查阅分发的包管理器文档:Consult the documentation for your distribution's package manager for the precise syntax in your environment:

apt-get(8) 由基于 Debian 的系统(包括 Ubuntu)使用。apt-get(8) is used by Debian based systems, including Ubuntu.

yum(8) 用于 Fedora、CentOS 和 Oracle Linux。yum(8) is used on Fedora, CentOS, and Oracle Linux.

zypper(8) 用于 openSUSE 和 SUSE Linux Enterprise System (SLES)。zypper(8) is used on openSUSE and SUSE Linux Enterprise System (SLES).

dnf(8) 用于 Fedora。dnf(8) is used on Fedora.

几乎在所有情况下,删除包的命令都是 remove。In almost all cases, the command to remove a package is remove.

大多数包管理器的 .NET SDK 安装包名称为 dotnet-sdk,后跟版本号。The package name for the .NET SDK installation for most package managers is dotnet-sdk, followed by the version number. 从 2.1.300 版 .NET SDK 和 2.1 版运行时开始,只需要主版本号和次版本号:例如,可将 .NET SDK 2.1.300 版引用为包 dotnet-sdk-2.1。Starting with the version 2.1.300 of the .NET SDK and version 2.1 of the runtime, only the major and minor version numbers are necessary: for example, the .NET SDK version 2.1.300 can be referenced as the package dotnet-sdk-2.1. 以前的版本则需要整个版本字符串:例如,2.1.200 版 .NET SDK 需要 dotnet-sdk-2.1.200。Prior versions require the entire version string: for example, dotnet-sdk-2.1.200 would be required for version 2.1.200 of the .NET SDK.

对于仅安装了运行时而未安装 SDK 的计算机,.NET 运行时的包名称为 dotnet-runtime-,整个运行时堆栈的包名称为 aspnetcore-runtime-。For machines that have installed only the runtime, and not the SDK, the package name is dotnet-runtime- for the .NET runtime, and aspnetcore-runtime- for the entire runtime stack.

提示

使用包管理器卸载 SDK 时,2.0 之前的 .NET Core 安装不会卸载主机应用程序。.NET Core installations earlier than 2.0 didn't uninstall the host application when the SDK was uninstalled using the package manager. 使用 apt-get,该命令为:Using apt-get, the command is:

apt-get remove dotnet-host

没有版本附加到 dotnet-host。There's no version attached to dotnet-host.

如果使用 tarball 安装,则必须手动删除 .NET。If you installed using a tarball, you must remove .NET using the manual method.

在 Linux 上,必须通过删除进行版本控制的目录,分别删除 SDK 和运行时。On Linux, you must remove the SDKs and runtimes separately, by removing the versioned directories. 这些目录可能因你的 Linux 分发版而异。These directories may vary depending on your Linux distribution. 删除它们会从磁盘中删除 SDK 和运行时。Removing them deletes the SDK and runtime from disk. 例如,要删除 1.0.1 SDK 和运行时,可使用以下 bash 命令:For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:

version="1.0.1"

sudo rm -rf /usr/share/dotnet/sdk/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.NETCore.App/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.All/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.App/$version

sudo rm -rf /usr/share/dotnet/host/fxr/$version

SDK 和运行时的父目录列在 dotnet --list-sdks 和 dotnet --list-runtimes 命令的输出中,如上表所示。The parent directories for the SDK and runtime are listed in the output from the dotnet --list-sdks and dotnet --list-runtimes command, as shown in the earlier table.

在 Mac 上,必须通过删除进行版本控制的目录,分别删除 SDK 和运行时。On Mac, you must remove the SDKs and runtimes separately, by removing the versioned directories. 删除它们会从磁盘中删除 SDK 和运行时。Removing them deletes the SDK and runtime from disk. 例如,要删除 1.0.1 SDK 和运行时,可使用以下 bash 命令:For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:

version="1.0.1"

sudo rm -rf /usr/local/share/dotnet/sdk/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.NETCore.App/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.All/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/$version

sudo rm -rf /usr/local/share/dotnet/host/fxr/$version

SDK 和运行时的父目录列在 dotnet --list-sdks 和 dotnet --list-runtimes 命令的输出中,如上表所示。The parent directories for the SDK and runtime are listed in the output from the dotnet --list-sdks and dotnet --list-runtimes command, as shown in the earlier table.

.NET 卸载工具.NET Uninstall Tool

你可以使用 .NET 卸载工具 (dotnet-core-uninstall) 从系统中删除 .NET SDK 和运行时。The .NET Uninstall Tool (dotnet-core-uninstall) lets you remove .NET SDKs and runtimes from a system. 可使用选项集合来指定应卸载的版本。A collection of options is available to specify which versions should be uninstalled.

.NET Core SDK 版本的 Visual Studio 依赖项Visual Studio dependency on .NET Core SDK versions

在 Visual Studio 2019 版本 16.3 之前,Visual Studio 安装程序称为独立的 .NET Core SDK 安装程序。Before Visual Studio 2019 version 16.3, Visual Studio installers called the standalone .NET Core SDK installer. 因此,SDK 版本显示在 Windows“应用和功能”对话框中 。As a result, the SDK versions appear in the Windows Apps & features dialog. 使用独立安装程序删除 Visual Studio 安装的 .NET Core SDK 可能会破坏 Visual Studio。Removing .NET Core SDKs that were installed by Visual Studio using the standalone installer may break Visual Studio. 如果 Visual Studio 在卸载 SDK 之后出现问题,请在该特定版本的 Visual Studio 上运行修复。If Visual Studio has problems after you uninstall SDKs, run Repair on that specific version of Visual Studio. 下表显示了 .NET Core SDK 版本的一些 Visual Studio 依赖项:The following table shows some of the Visual Studio dependencies on .NET Core SDK versions:

Visual Studio 版本Visual Studio version

.NET Core SDK 版本.NET Core SDK version

Visual Studio 2019 版本 16.2Visual Studio 2019 version 16.2

.NET Core SDK 2.2.4xx、2.1.8xx.NET Core SDK 2.2.4xx, 2.1.8xx

Visual Studio 2019 版本 16.1Visual Studio 2019 version 16.1

.NET Core SDK 2.2.3xx、2.1.7xx.NET Core SDK 2.2.3xx, 2.1.7xx

Visual Studio 2019 版本 16.0Visual Studio 2019 version 16.0

.NET Core SDK 2.2.2xx、2.1.6xx.NET Core SDK 2.2.2xx, 2.1.6xx

Visual Studio 2017 版本 15.9Visual Studio 2017 version 15.9

.NET Core SDK 2.2.1xx、2.1.5xx.NET Core SDK 2.2.1xx, 2.1.5xx

Visual Studio 2017 版本 15.8Visual Studio 2017 version 15.8

.NET Core SDK 2.1.4xx.NET Core SDK 2.1.4xx

从 Visual Studio 2019 16.3 版开始,Visual Studio 负责其自己的 .NET SDK 副本。Starting with Visual Studio 2019 version 16.3, Visual Studio is in charge of its own copy of the .NET SDK. 因此,“应用和功能”对话框中将不再显示这些 SDK 版本 。For that reason, you no longer see those SDK versions in the Apps & features dialog.

删除 NuGet 回退文件夹Remove the NuGet fallback folder

在 .NET Core 3.0 SDK 之前,.NET Core SDK 安装程序使用名为 NuGetFallbackFolder 的文件夹存储 NuGet 包的缓存 。Before .NET Core 3.0 SDK, the .NET Core SDK installers used a folder named NuGetFallbackFolder to store a cache of NuGet packages. 此缓存在操作期间(如 dotnet restore 或 dotnet build /t:Restore)使用。This cache was used during operations such as dotnet restore or dotnet build /t:Restore. NuGetFallbackFolder 在 Windows 上位于 C:\Program Files\dotnet\sdk,在 macOS 上位于 /usr/local/share/dotnet/sdk 。The NuGetFallbackFolder is located at C:\Program Files\dotnet\sdk on Windows and at /usr/local/share/dotnet/sdk on macOS.

如果是以下情况,则可能需要删除此文件夹:You may want to remove this folder, if:

仅使用 .NET Core 3.0 SDK 或 .NET 5.0(或更高版本)进行开发。You're only developing using .NET Core 3.0 SDK or .NET 5.0 or later versions.

你使用早于 3.0 的 .NET Core SDK 版本进行开发,但可以联机工作。You're developing using .NET Core SDK versions earlier than 3.0, but you can work online.

如果要删除 NuGet 回退文件夹,可以将其删除,但需要管理员权限才能执行此操作。If you want to remove the NuGet fallback folder, you can delete it, but you'll need admin privileges to do so.

建议不要删除 dotnet 文件夹。It's not recommended to delete the dotnet folder. 这样做会删除以前安装的所有全局工具。Doing so would remove any global tools you've previously installed. 此外,在 Windows 上:Also, on Windows:

你将中断 Visual Studio 2019 版本 16.3 及更高版本。You'll break Visual Studio 2019 version 16.3 and later versions. 可以运行“修复” 来恢复。You can run Repair to recover.

如果“应用和功能”对话框中存在 .NET Core SDK 条目,它们将是孤立的 。If there are .NET Core SDK entries in the Apps & features dialog, they'll be orphaned.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42514222/article/details/116383259

智能推荐

oracle 12c 集群安装后的检查_12c查看crs状态-程序员宅基地

文章浏览阅读1.6k次。安装配置gi、安装数据库软件、dbca建库见下:http://blog.csdn.net/kadwf123/article/details/784299611、检查集群节点及状态:[root@rac2 ~]# olsnodes -srac1 Activerac2 Activerac3 Activerac4 Active[root@rac2 ~]_12c查看crs状态

解决jupyter notebook无法找到虚拟环境的问题_jupyter没有pytorch环境-程序员宅基地

文章浏览阅读1.3w次,点赞45次,收藏99次。我个人用的是anaconda3的一个python集成环境,自带jupyter notebook,但在我打开jupyter notebook界面后,却找不到对应的虚拟环境,原来是jupyter notebook只是通用于下载anaconda时自带的环境,其他环境要想使用必须手动下载一些库:1.首先进入到自己创建的虚拟环境(pytorch是虚拟环境的名字)activate pytorch2.在该环境下下载这个库conda install ipykernelconda install nb__jupyter没有pytorch环境

国内安装scoop的保姆教程_scoop-cn-程序员宅基地

文章浏览阅读5.2k次,点赞19次,收藏28次。选择scoop纯属意外,也是无奈,因为电脑用户被锁了管理员权限,所有exe安装程序都无法安装,只可以用绿色软件,最后被我发现scoop,省去了到处下载XXX绿色版的烦恼,当然scoop里需要管理员权限的软件也跟我无缘了(譬如everything)。推荐添加dorado这个bucket镜像,里面很多中文软件,但是部分国外的软件下载地址在github,可能无法下载。以上两个是官方bucket的国内镜像,所有软件建议优先从这里下载。上面可以看到很多bucket以及软件数。如果官网登陆不了可以试一下以下方式。_scoop-cn

Element ui colorpicker在Vue中的使用_vue el-color-picker-程序员宅基地

文章浏览阅读4.5k次,点赞2次,收藏3次。首先要有一个color-picker组件 <el-color-picker v-model="headcolor"></el-color-picker>在data里面data() { return {headcolor: ’ #278add ’ //这里可以选择一个默认的颜色} }然后在你想要改变颜色的地方用v-bind绑定就好了,例如:这里的:sty..._vue el-color-picker

迅为iTOP-4412精英版之烧写内核移植后的镜像_exynos 4412 刷机-程序员宅基地

文章浏览阅读640次。基于芯片日益增长的问题,所以内核开发者们引入了新的方法,就是在内核中只保留函数,而数据则不包含,由用户(应用程序员)自己把数据按照规定的格式编写,并放在约定的地方,为了不占用过多的内存,还要求数据以根精简的方式编写。boot启动时,传参给内核,告诉内核设备树文件和kernel的位置,内核启动时根据地址去找到设备树文件,再利用专用的编译器去反编译dtb文件,将dtb还原成数据结构,以供驱动的函数去调用。firmware是三星的一个固件的设备信息,因为找不到固件,所以内核启动不成功。_exynos 4412 刷机

Linux系统配置jdk_linux配置jdk-程序员宅基地

文章浏览阅读2w次,点赞24次,收藏42次。Linux系统配置jdkLinux学习教程,Linux入门教程(超详细)_linux配置jdk

随便推点

matlab(4):特殊符号的输入_matlab微米怎么输入-程序员宅基地

文章浏览阅读3.3k次,点赞5次,收藏19次。xlabel('\delta');ylabel('AUC');具体符号的对照表参照下图:_matlab微米怎么输入

C语言程序设计-文件(打开与关闭、顺序、二进制读写)-程序员宅基地

文章浏览阅读119次。顺序读写指的是按照文件中数据的顺序进行读取或写入。对于文本文件,可以使用fgets、fputs、fscanf、fprintf等函数进行顺序读写。在C语言中,对文件的操作通常涉及文件的打开、读写以及关闭。文件的打开使用fopen函数,而关闭则使用fclose函数。在C语言中,可以使用fread和fwrite函数进行二进制读写。‍ Biaoge 于2024-03-09 23:51发布 阅读量:7 ️文章类型:【 C语言程序设计 】在C语言中,用于打开文件的函数是____,用于关闭文件的函数是____。

Touchdesigner自学笔记之三_touchdesigner怎么让一个模型跟着鼠标移动-程序员宅基地

文章浏览阅读3.4k次,点赞2次,收藏13次。跟随鼠标移动的粒子以grid(SOP)为partical(SOP)的资源模板,调整后连接【Geo组合+point spirit(MAT)】,在连接【feedback组合】适当调整。影响粒子动态的节点【metaball(SOP)+force(SOP)】添加mouse in(CHOP)鼠标位置到metaball的坐标,实现鼠标影响。..._touchdesigner怎么让一个模型跟着鼠标移动

【附源码】基于java的校园停车场管理系统的设计与实现61m0e9计算机毕设SSM_基于java技术的停车场管理系统实现与设计-程序员宅基地

文章浏览阅读178次。项目运行环境配置:Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。项目技术:Springboot + mybatis + Maven +mysql5.7或8.0+html+css+js等等组成,B/S模式 + Maven管理等等。环境需要1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。_基于java技术的停车场管理系统实现与设计

Android系统播放器MediaPlayer源码分析_android多媒体播放源码分析 时序图-程序员宅基地

文章浏览阅读3.5k次。前言对于MediaPlayer播放器的源码分析内容相对来说比较多,会从Java-&amp;amp;gt;Jni-&amp;amp;gt;C/C++慢慢分析,后面会慢慢更新。另外,博客只作为自己学习记录的一种方式,对于其他的不过多的评论。MediaPlayerDemopublic class MainActivity extends AppCompatActivity implements SurfaceHolder.Cal..._android多媒体播放源码分析 时序图

java 数据结构与算法 ——快速排序法-程序员宅基地

文章浏览阅读2.4k次,点赞41次,收藏13次。java 数据结构与算法 ——快速排序法_快速排序法