6

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?

RonSpa
  • 89
  • 1
  • 4

4 Answers4

8

Try using this. This should disable the telemetry data collection.

export DOTNET_CLI_TELEMETRY_OPTOUT=1

Update: I agree with XPhyro. One can add this to the ~/.bash_profile as well.

Ronnie Rahman
  • 316
  • 3
  • 9
  • 2
    It could be added that this line should go into your `~/.bash_profile` or a similar file if you do not use bash or have changed its path. – XPhyro Oct 28 '20 at 09:52
5

on windows in CMD or powerShell

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

On linux, export to your bash profile

//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
Transformer
  • 6,963
  • 2
  • 26
  • 52
4

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.

Botan
  • 746
  • 3
  • 11
0

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

Mark
  • 2,196
  • 1
  • 14
  • 8