How do I stop .NET Telemetry to stop collecting data in Ubuntu Linux
Asked Answered
J

4

9

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?

Jocko answered 28/10, 2020 at 9:39 Comment(0)
L
10

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.

Luggage answered 28/10, 2020 at 9:40 Comment(1)
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.Plexor
M
8

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
Maladroit answered 8/2, 2021 at 17:56 Comment(0)
K
5

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.

Kazukokb answered 1/3, 2022 at 3:5 Comment(0)
S
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

Sharpnosed answered 26/5, 2022 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.