如何停止 .NET Telemetry 以停止在 Ubuntu Linux 中收集数据

Ron*_*Spa 7 .net linux ubuntu telemetry

当更新我的 ubuntu 系统时,我看到以下消息。**遥测

.NET Core 工具收集使用数据,以帮助我们改善您的体验。数据是匿名的,不包括命令行参数。这些数据由 Microsoft 收集并与社区共享。您可以使用您喜欢的 shell 将 DOTNET_CLI_TELEMETRY_OPTOUT 环境变量设置为“1”或“true”来选择退出遥测。了解有关 .NET Core CLI 工具遥测的更多信息:https://aka.ms/dotnet-cli-telemetry* *

如何禁用遥测收集数据?

Ron*_*man 9

尝试使用这个。这应该禁用遥测数据收集。

export DOTNET_CLI_TELEMETRY_OPTOUT=1
Run Code Online (Sandbox Code Playgroud)

更新:我同意 XPhyro 的观点。人们也可以将其添加到 ~/.bash_profile 中。

  • 可以补充的是,如果您不使用 bash 或更改了其路径,则该行应放入您的“~/.bash_profile”或类似文件中。 (2认同)

tra*_*mer 6

在 Windows 上的 CMD 或 powerShell 中

set DOTNET_CLI_TELEMETRY_OPTOUT=1 
//or true
set DOTNET_CLI_TELEMETRY_OPTOUT=true
Run Code Online (Sandbox Code Playgroud)

在 Linux 上,导出到您的 bash 配置文件

//This will open the nano text editor with your bash profile file.
nano ~/.bash_profile
 the following line at the end of the file:

// then type this, Save the changes Ctrl+X -> Y, finally -> Enter.
export DOTNET_CLI_TELEMETRY_OPTOUT=1

// finally reload
source ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)


小智 5

如果您使用 Ubuntu 并希望为所有用户永久禁用 Microsoft .NET 遥测,则可以通过DOTNET_CLI_TELEMETRY_OPTOUT=1向文件添加行来完成/etc/environment

https://help.ubuntu.com/community/EnvironmentVariables

/etc/environment 是影响整个系统(而不仅仅是特定用户)的环境变量设置的合适文件。

另请参阅关于在 /etc/environment 与 .profile 中设置 PATH 变量以及如何在我的 Linux 系统下为每个人设置环境变量?问题了解更多详情。