Adding software to PATH

Hi,

Via the software store I installed VSCode and some other programs. Normally when installing on windows you can add them to your path so you can call them from the terminal.

Example

code

And this will open your pwd into vscode

So I thought Ill add it to my path... I checked where the executable is with commands like whereis but yea... It was not available in terminal so it didn't find the executable. How to fix this?

If it was installed as a flatpak it's possible it didn't register in the PATH. Run flatpak list to verify if this is the case. I would suggest to install VSCode using deb package instead, since you will most likely want to use the integrated terminal anyway.

Uninstall from flatpak and then from the software store make sure the "source" selected is .deb and not flatpak.

2 Likes
Visual Studio Code                                       com.visualstudio.code                          1.73.1-1667967334               stable            flathub            system

Fair point. But VSCode was just a example. How to do this with other software aswell?

You may need to provide specific examples since you can with most other software by default.

1 Like

I have moved a lot of downloads over to snapcraft since that works so flawless on Zorin. Ill see when I'm off metered connection if snap is available within the Software app. Thanks for the responses :slight_smile:

Snap may be the issue since it creates another layer of obfuscation (unnecessarily) to protect system files. This may seem great, but it duplicates libraries (like the gtk2 & gtk3) each time you install another snap. It also causes you to have to find work arounds in order to get the software to communicate with the system where it would normally by itself. An ide should integrate with the system (its even in the very name... integrated development environment). Use apt or a .deb to install such software and use virtual environments to isolate libraries, installed packages and modules for each project. Snap may seem easier, but you'll run into headaches you can avoid by integrating, as it should be.

Apt is how I've installed VSCode, IntelliJ IDEA community edition and Android Studio. I can code in python, javascript and Java from any of these IDE's without issue, all of which added themselves to the PATH and all use a custom workspace directory I added to PATH.

I actually didn't know this as I try to keep the number of flatpaks/snaps/appimages to a minimum, and then usually run them from the launcher instead.

But apparently the executable is isolated behind Flatpak itself so you need a separate command for it to work. I would recommend setting up an alias for it.