Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Make every deb line a comment, this should disable the microsoft repository referenced in vscode.list
sed -i -e 's/^deb/# deb/' /etc/apt/sources.list.d/vscode.list
# Remove the microsoft gpg key and replace with an empty file
rm /etc/apt/trusted.gpg.d/microsoft.gpg && touch /etc/apt/trusted.gpg.d/microsoft.gpg
# Mark files as immutable to avoid changes from updates
chattr +i /etc/apt/trusted.gpg.d/microsoft.gpg
chattr +i /etc/apt/sources.list.d/vscode.list
# Add entry to hosts file to hide packages.microsoft.com
echo '# Disable packages.microsoft.com' >> /etc/hosts
echo '127.0.0.1 packages.microsoft.com' >> /etc/hosts
# Check files, check regulary that telemetry is still disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment