This guide provides step-by-step instructions on how to manually install Visual Studio Code (VSCode) on a Manjaro Linux system, including how to extract the tarball, rename the folder, move it to a proper directory, create a desktop entry, and set up an icon.
First, visit the official VSCode download page and download the tar.gz version for Linux (e.g., code-stable-x64-<version>.tar.gz).
After downloading the tarball, open a terminal and navigate to the directory where the .tar.gz file was downloaded:
cd ~/DownloadsNow, extract the tarball using the following command:
tar -xvzf code-stable-x64-<version>.tar.gzReplace <version> with the actual version number of the file you downloaded.
The extracted folder name will likely look like VSCode-linux-x64. Rename the folder to vscode to make it easier to manage:
mv VSCode-linux-x64 vscodeMove the vscode folder to the /opt directory to keep it organized for system-wide applications:
sudo mv vscode /opt/To easily launch VSCode from the terminal, add the /opt/vscode directory to your PATH. Open your .bashrc or .zshrc file:
nano ~/.bashrc # or use ~/.zshrc for zsh usersAdd the following line at the end of the file:
export PATH="$PATH:/opt/vscode/bin"Save and exit the editor (Ctrl + O, Enter, then Ctrl + X for nano). To apply the changes, source the file:
source ~/.bashrc # or source ~/.zshrc for zsh usersNow you can launch VSCode by typing code in the terminal.
To create a desktop entry that will allow you to launch VSCode from your applications menu, follow these steps:
-
Open a text editor to create the desktop entry. You can use
nanoas follows:sudo nano /usr/share/applications/vscode.desktop
-
Add the following content to the
vscode.desktopfile:[Desktop Entry] Version=1.0 Name=Visual Studio Code Comment=Code Editing. Redefined. Exec=/opt/vscode/code --no-sandbox %F Icon=/opt/vscode/resources/app/resources/linux/code.png Terminal=false Type=Application Categories=Development;IDE;
-
Save the file and exit the text editor. In
nano, pressCtrl + O, thenCtrl + Xto save and exit.
Set the correct permissions for the .desktop file to make it executable:
sudo chmod +x /usr/share/applications/vscode.desktopIf you want the VSCode icon on your desktop for easy access, create a symbolic link to the .desktop file:
ln -s /usr/share/applications/vscode.desktop ~/Desktop/Now you can either search for "Visual Studio Code" in your application menu or launch it from the terminal by running:
/opt/vscode/codeSince the vscode://vscode protocol is not registered on Manjaro by default, you will need to use the local server method to authenticate with GitHub in VSCode.
- Open VSCode and click on Sign in with GitHub.
- A new browser window will open asking you to authenticate. Cancel the request in VSCode, you'll be prompted to use the local server.
- Use the local server to authenticate.
To update your manually installed version of VSCode:
- Download the latest
.tar.gzfile from the official website. - Follow the same extraction process as outlined above.
- Rename the extracted folder to
vscodeif necessary and move it to/opt/to replace the old version. - The desktop entry and icon will remain unchanged unless updated manually.
Note: The update process involves replacing the contents of the
/opt/vscodefolder, so it’s recommended to back up any settings or custom extensions if necessary before updating.
- VSCode doesn't launch: Ensure that the permissions for the
.desktopfile are correctly set (chmod +x). - Icon doesn't appear: Make sure that the
Iconfield in the.desktopfile points to the correct path of thecode.pngfile inside the/opt/vscode/resources/app/resources/linux/directory.
This guide was last updated on March 24, 2025.