How to Install Applications from .tar.gz Files and Add Them to the Menu in Linux Mint (VS Code Example)

If you're using Ubuntu or Linux Mint, you've probably noticed that some applications are only available as .tar.gz files. These are compressed, distribution-agnostic packages, unlike .deb files which are tailored to Debian-based systems.

This article walks you through how to install applications from .tar.gz files and make them appear in your system's application menu using Visual Studio Code as an example.


Why Use .tar.gz Instead of .deb?

In my case, I have Linux Mint installed on an SSD with limited space, so I prefer installing applications on my larger HDD. While many applications offer .deb installers, some only provide .tar.gz packages.


Step 1: Download the .tar.gz File

Go to the Visual Studio Code website and download the .tar.gz version suitable for your system's CPU architecture (typically x64 for modern systems).


Step 2: Extract the File to Your Desired Location

  1. Move the .tar.gz file to the HDD or any other directory where you want to keep the application.

  2. Right-click on the file and choose "Extract Here".

After extraction, you'll find a folder (e.g., VSCode-linux-x64) containing an executable file named code.

Double-click on the code file to launch Visual Studio Code.


Step 3: Create a .desktop File

This step allows VS Code to show up in your system's app launcher and "Open With" context menu.

Open Terminal in the Applications Folder:

cd ~/.local/share/applications

This is the directory for user-specific application launchers. Use /usr/share/applications if you want to make it available system-wide.

Create and Edit the .desktop File:

nano vscode.desktop

This opens the nano text editor.

Paste the Following Configuration:

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
Exec=/<hard_drive_path>/Installers/VSCode/VSCode-linux-x64/code --open-file %F
Icon=/<hard_drive_path>/Installers/VSCode/VSCode-linux-x64/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Development;
MimeType=text/plain;inode/directory;
StartupNotify=true
StartupWMClass=Code

Explanation:

  • Name: Name shown in menus.

  • Comment: Tooltip text.

  • Exec: Full path to the executable (modify as per your actual path).

  • Icon: Path to the VS Code icon file (modify as per your actual path).

  • Terminal: Should VS Code run in a terminal? Set to false.

  • Type: Indicates it is an application.

  • Categories: Helps categorize in the menu.

  • MimeType: Makes it appear in "Open With" for files/folders.

  • StartupNotify and StartupWMClass: Used for window management and startup animations.

Press Ctrl+S to save and Ctrl+X to exit.


Step 4: Make the File Executable

chmod +x vscode.desktop

This command makes the .desktop file executable so the system recognizes it as a valid application launcher.


Step 5: Update the Desktop Database

update-desktop-database .

This command refreshes the desktop environment’s application cache. The . ensures it runs in the current directory (share/applications directory).


Step 6: Use "Open With VS Code"

Now, right-click on any text file (like .py, .js, or .txt) → Open With Other Application → you should see Visual Studio Code in the list.

Congratulations! You’ve successfully installed VS Code using a .tar.gz file and added it to your system's menu.


This method works for many other applications distributed as .tar.gz. Just adjust the paths and names accordingly.

0
Subscribe to my newsletter

Read articles from Ashutosh Chapagain directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ashutosh Chapagain
Ashutosh Chapagain