forked from codeperfectplus/HackScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_vscode.sh
39 lines (29 loc) · 1.14 KB
/
setup_vscode.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Script to install Visual Studio Code on a Linux system
# status: tested
# published by: Deepak Raj
# published on: 2024-08-28
# Exit immediately if a command exits with a non-zero status
set -e
# Update package lists
echo "Updating package lists..."
sudo apt-get update
# Install prerequisites
echo "Installing prerequisites..."
sudo apt-get install -y wget gpg
# Add Microsoft’s GPG key
echo "Adding Microsoft GPG key..."
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-archive-keyring.gpg
# Add VS Code repository
echo "Adding VS Code repository..."
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
# Update package lists again with the new repository
echo "Updating package lists with VS Code repository..."
sudo apt-get update
# Install VS Code
echo "Installing VS Code..."
sudo apt-get install -y code
# Verify installation
echo "Verifying VS Code installation..."
code --version
echo "Visual Studio Code installation completed."