Skip to content

Instantly share code, notes, and snippets.

@IdrisAkintobi
Created March 24, 2025 13:29
Show Gist options
  • Save IdrisAkintobi/b422237c3b35ad70d4f3ce300775c358 to your computer and use it in GitHub Desktop.
Save IdrisAkintobi/b422237c3b35ad70d4f3ce300775c358 to your computer and use it in GitHub Desktop.
Install VS Code on Manjaro

Visual Studio Code (VSCode) Manual Installation on Manjaro

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.

Installation Instructions

1. Download VSCode

First, visit the official VSCode download page and download the tar.gz version for Linux (e.g., code-stable-x64-<version>.tar.gz).

2. Extract the tar.gz File

After downloading the tarball, open a terminal and navigate to the directory where the .tar.gz file was downloaded:

cd ~/Downloads

Now, extract the tarball using the following command:

tar -xvzf code-stable-x64-<version>.tar.gz

Replace <version> with the actual version number of the file you downloaded.

3. Rename the Folder

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 vscode

4. Move the Extracted Folder to a Suitable Location

Move the vscode folder to the /opt directory to keep it organized for system-wide applications:

sudo mv vscode /opt/

5. Add VSCode to PATH

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 users

Add 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 users

Now you can launch VSCode by typing code in the terminal.

6. Create a Desktop Icon

To create a desktop entry that will allow you to launch VSCode from your applications menu, follow these steps:

  1. Open a text editor to create the desktop entry. You can use nano as follows:

    sudo nano /usr/share/applications/vscode.desktop
  2. Add the following content to the vscode.desktop file:

    [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;
  3. Save the file and exit the text editor. In nano, press Ctrl + O, then Ctrl + X to save and exit.

7. Set Permissions for the Desktop Entry

Set the correct permissions for the .desktop file to make it executable:

sudo chmod +x /usr/share/applications/vscode.desktop

8. Optionally Create a Desktop Shortcut

If 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/

9. Launch VSCode

Now you can either search for "Visual Studio Code" in your application menu or launch it from the terminal by running:

/opt/vscode/code

Authenticating with GitHub in VSCode

Since 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.

  1. Open VSCode and click on Sign in with GitHub.
  2. A new browser window will open asking you to authenticate. Cancel the request in VSCode, you'll be prompted to use the local server.
  3. Use the local server to authenticate.

Updating VSCode

To update your manually installed version of VSCode:

  1. Download the latest .tar.gz file from the official website.
  2. Follow the same extraction process as outlined above.
  3. Rename the extracted folder to vscode if necessary and move it to /opt/ to replace the old version.
  4. The desktop entry and icon will remain unchanged unless updated manually.

Note: The update process involves replacing the contents of the /opt/vscode folder, so it’s recommended to back up any settings or custom extensions if necessary before updating.

Troubleshooting

  • VSCode doesn't launch: Ensure that the permissions for the .desktop file are correctly set (chmod +x).
  • Icon doesn't appear: Make sure that the Icon field in the .desktop file points to the correct path of the code.png file inside the /opt/vscode/resources/app/resources/linux/ directory.

This guide was last updated on March 24, 2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment