Trying to install VS Code

Hi,

I installed VS code from the Software, however some message appeared after opening it.


Warning: You are running an unofficial Flatpak version of Visual Studio Code !!!

Please open issues under: Issues · flathub/com.visualstudio.code · GitHub

This version is running inside a container and is therefore not able
to access SDKs on your host system!

To execute commands on the host system, run inside the sandbox:

$ flatpak-spawn --host

To make the Integrated Terminal automatically use the host system's shell,
you can add this to the settings:

{
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/usr/bin/flatpak-spawn",
"args": ["--host", "--env=TERM=xterm-256color", "bash"]
}
}
}

This flatpak provides a standard development environment (gcc, python, etc).
To see what's available:

$ flatpak run --command=sh com.visualstudio.code
$ ls /usr/bin (shared runtime)
$ ls /app/bin (bundled with this flatpak)

To get support for additional languages, you have to install SDK extensions, e.g.

$ flatpak install flathub org.freedesktop.Sdk.Extension.dotnet
$ flatpak install flathub org.freedesktop.Sdk.Extension.golang
$ FLATPAK_ENABLE_SDK_EXT=dotnet,golang flatpak run com.visualstudio.code

You can use

$ flatpak search

to find others.

Then i tried to install the sdk manually , but this is the message i get after.

$ dotnet --list-sdks

Command 'dotnet' not found, but can be installed with:

sudo snap install dotnet-sdk

I tried the above Sudo and i get this message,

$ sudo snap install dotnet-sdk
error: This revision of snap "dotnet-sdk" was published using classic
confinement and thus may perform arbitrary system changes outside of the
security sandbox that snaps are usually confined to, which may put your
system at risk.

   If you understand and want to proceed repeat the command including
   --classic.

What do this means? Is it unsecure to install it ?
or is there a better way to install VS code without flatpak warnings?

No it is not necessarily unsecure...You can install it using snap..However, I prefer using the deb version instead. You can download the deb file here:

Snaps and Flatpaks sandbox the app into container so that the app can't mess with your system files. But since VSCode is an ide, it needs to use some compilers that come with the linux system. I had the same problem. I used the deb file to install it.

4 Likes

Flatpak isn't insecure, it's just that Flatpak isn't really the optimal way to install VSCode or VSCodium as it all runs in a sandbox

whilst you can use it just fine (like I do), you might need to download some SDK extensions (for Node.js for instance) in the future, or allow permission to your /home/ folder through Flatseal

In general, it's just a little bit more of a hassle for VSCode/Codium specifically compared to installing native versions from https://code.visualstudio.com/

1 Like

I don't know about flatpak, but through snaps I've heard issues with running commands from the integrated terminal. I think this is the type of program that you'd want to install directly to avoid any issues.

Whilst these 'pak' options may not be insecure, they create huge update problems as they don't use the 'apt' command. It's a bit like 3rd Party Browsers when your system states it can't find an update for the Browser. Apart from that flatpaks create huge bloatware in the system as I watched the amount of flatpak c r a p being restored during a Timeshift restore on another system.

1 Like

I recommend that you uninstall the snap version. Use the .deb version so it updates with your system (important especially since we have kernel updates which may raise the version of code needed for that kernel [i hope that makes sense]). It will then be easier to work with pip, it will utilize installed SDK's since they'll be listed in the system path by default.

This has made it much easier to write code and run it without issue.

Make sure when you use pip to add the --user flag so it doesn't write to the system dist-packages. Then include the site-packages in path (i modified bashrc to include it).

Hope this helps you get your setup straight. Happy coding.

3 Likes

ok, i'll do this

you do realise Flatpak and Snap were specifically designed so you didn't have to use apt, pacman, or other package managers, and instead to have something distribution-agnostic?

and what is "Flatpak c r a p" supposed to be exactly?

Bloatware.

Bloat is subjective.

I explained in a previous post when using Timeshift to restore a different flatpak based OS - the amount of flatpak references of packages being recovered was like a Tsunami - an exaggeration I know but it looked horrendous!

well it's programs and dependencies, that makes sense

it'd look just the same if it didn't backup /bin but instead just saved a list of programs and restored that through APT lol

Timeshift is quick and efficient.

when did I say it wasn't lol

I would put forth that any time that redundant or doubled-up data is stored on a machine, it qualifies as "bloat."
Multiple Back-Ups can be bloat. It is bloat that we are willing to accept, sometimes.
Flatpak brings bloat because it carries redundant data: Dependencies that you already have installed on your system, but included with the Flatpak because it isolates itself away from your system. This is bloat. The only question is whether or not the user is willing to accept that bloat.

My personal opinion is that Flatpak is preferable to Snap.
It's not as bad as Snap, in other words.
But also, for me, totally avoidable.
Flatpak, for me, does not add ease, convenience or functionality - and it takes up more space and refuses to cooperate with the system due to its redundant sandbox.
For some users, Flatpak offers something in the ability to install a later Package. This does not always work, though and the more "latest" packages a user installs, the more bloat that they will end up with. Even so, Flatpak can be useful for the Right Reasons. But is still not a viable replacement for APT. It adds too little, when it does add - and takes away too much.

4 Likes

I do not know much about Flatpack or Snap. Just normal windows user fed up with slow and bugs after each major updates that i migrated to linux. Tried Ubuntu then Mint then Zorin. (would have been manjaro if it could install properly but since it failed, the next one i tried is Zorin and it has been a blessing for me).

Only need few things to do my daily works. Internet+browser+excell/sheets. Still learning libreoffice and trying to figure out how to make a database out of it so my work won't be completely dependant on internet especially when its down like onedrive atm. even google.com seem to be inaccessible for me since last week. sorry for the rants that not Zorin issues...

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.