'How do I stop .NET Telemetry to stop collecting data in Ubuntu Linux

When updating my ubuntu system I saw the following messages. **Telemetry

The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry**

How can I disable the telemetry from collecting data?



Solution 1:[1]

on windows in CMD or powerShell

set DOTNET_CLI_TELEMETRY_OPTOUT=1 
//or true
set DOTNET_CLI_TELEMETRY_OPTOUT=true

Solution 2:[2]

If you are using Ubuntu and want to disable Microsoft .NET telemetry permanently for all users then it can be done by adding DOTNET_CLI_TELEMETRY_OPTOUT=1 line to /etc/environment file.

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

A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is /etc/environment.

Also please see answers on Setting PATH variable in /etc/environment vs .profile and How to set environment variable for everyone under my linux system? questions for more details.

Solution 3:[3]

In Fedora [for reference, or people following search results; Ubuntu may be different] the dotnet .rpm installs a script at etc/profile.d/dotnet-cli-tools-bin-path.sh that initially contains only export PATH="$PATH:$HOME/.dotnet/tools"

That seems a very good place to add DOTNET_CLI_TELEMETRY_OPTOUT=1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Transformer
Solution 2 Botan
Solution 3 Mark