How to Install Visual Studio Code on Linux
Visual Studio Code (VS Code) is a lightweight and powerful code editor developed by Microsoft. It supports multiple programming languages and includes features like IntelliSense, debugging, and Git integration.
Step-by-Step Installation (Ubuntu/Debian-based Systems)
1. Update the Package Index
sudo apt update
2. Install Required Dependencies
sudo apt install software-properties-common apt-transport-https wget
3. Import the Microsoft GPG Key
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
4. Add the VS Code Repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
5. Install Visual Studio Code
sudo apt update
sudo apt install code
Installing on Fedora / RHEL
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
sudo dnf check-update
sudo dnf install code
Installing on Arch Linux / Manjaro
Use an AUR helper like yay:
yay -S visual-studio-code-bin
Launching VS Code
After installation, launch it from your app menu or run:
code
Install Popular Extensions
code --install-extension ms-python.python
code --install-extension esbenp.prettier-vscode
Uninstalling VS Code
To remove VS Code if needed:
sudo apt remove code # Ubuntu/Debian
sudo dnf remove code # Fedora/RHEL
yay -Rns visual-studio-code-bin # Arch/Manjaro
Conclusion
Visual Studio Code is a must-have tool for developers. With this guide, you can easily install and get started with VS Code on your Linux system, regardless of your distribution.

No comments:
Post a Comment
Thank you