File System in Browser vs. Codeblocks Browser

By trying to add the gcc compiler to the PATH variable, I encountered a strange issue: While in CodeBlocks, this gcc compiler is obviously used and one can browse it to be under /usr/bin, it is not possible to find it under the usual browser under /usr/bin! In fact, they seem to differ in general, e.g. the “app” folder only being visible in the CodeBlocks browser (see attached picture).

So somehow the “File Systems” folder and the “/” folder of my system seem to differ, either in reality, or in visibility in Codeblocks and usual file browser. So my question would be of how to access the /usr/bin folder outside CodeBlocks in a way as to see gcc, g++, ar and the like.

Note that I am aware that it is possible to set up a developer environment via flatpack (and I am going to try that as well), but just for the sake of understanding my Linux system better and to actually be able to access things like I want. Also, if gcc compiler is already installed, it would seem unnatural to me to need a workaround via flatpack in addition to that.

Thanks in advance

Ah, and furthermore, there is also a GCC Sdk extension in the App Center as package, which is quite large, and I would like to know what this actually is (I could not find a documentation, only sources from github). Sorry for the many questions, but I think it seems natural and is probably also desired, as Endless seems to be quite new and still under development. :wink:

Hi, you noticed correctly!

This is actually already how a Flatpak developer environment works. When you are running the CodeBlocks app, you are inside that developer environment, which contains GCC and other tools. The base OS, which you see outside of the app, doesn’t contain any compilers.

To enter the environment and get GCC in your path, you can do one of the following commands in a terminal:

  • flatpak run -d --command=bash org.codeblocks.App — This starts up exactly the environment that CodeBlocks runs in, but just in a terminal, without starting the IDE.
  • flatpak run --command=bash org.gnome.Sdk — This is more general, it starts up the environment that CodeBlocks is based on.

When outside of CodeBlocks or a Flatpak environment, it is possible to find the files that appear under /usr/bin, but they won’t run.

there is also a GCC Sdk extension in the App Center

This comes from flathub.org, and is used for app builds or developer environments that require GCC 7.x specifically.

Thanks for the answer. I think I am slowly getting the idea of a sandboxed environment now. So the terminal basicall y calls different /bash’s (–command=bash) from the different applications, right? Then there would of course be the question, if it’s possible to have multiple ones available at the same time. :grin: Let’s see if I can find some way.

What I further noticed is that, when creating another folder and copying the contents from /usr into that folder (say /home/user) - and the same with /etc and so on, keeping the relative paths of those directories, and then extend my PATH variable to those locations, then, in the “normal” terminal, I still have my commands apt-get, chdir, chmod and so on, however, in sandboxed mode, the “make” and the like are not available anymore. Any idea?

I tried to workaround the read-only issue by having a copy of the /usr folder. It is, for example, necessary if I want to install perl-tk (which seems not to be installed yet, at least the gui for TexLive tells me that I lack this dependency. Perl is installed, but not the package perl-tk. Similarly, libapt-pkg-dev seems not to be there, at least it isn’t found.

if it’s possible to have multiple ones available at the same time.

Yes, that is possible. You can, for example, open one sandbox in one terminal window, and another in another.

then, in the “normal” terminal, I still have my commands apt-get, chdir, chmod and so on, however, in sandboxed mode, the “make” and the like are not available anymore. Any idea?

For technical reasons, the apt-get program is present in the PATH on Endless, but it doesn’t do anything. It won’t show up in any sandboxed environments, because there’s nothing for it to do there.

In my previous post I should have included the -d flag in flatpak run -d --command=bash org.codeblocks.App — it means “add developer tools.” (If running the org.gnome.Sdk sandbox, the developer tools should be added automatically.) If you add that flag, then make and the other tools should be present.

I tried to workaround the read-only issue by having a copy of the /usr folder.

I wouldn’t recommend this. Instead of copying, it should be possible to install only the files you want in ~/.local, and set your environment variables appropriately. Try to configure perl-tk with --prefix=$HOME/.local or something like that.

If that fails, you can also build your own sandbox environment. Check out, for example, Construire votre premier Flatpak - Documentation Flatpak

Similarly, libapt-pkg-dev seems not to be there, at least it isn’t found.

There should be a way to make whatever you are installing not depend on libapt-pkg-dev. It won’t be possible to install that on Endless or in a Flatpak sandbox. But Linux distributions like Fedora or Arch also don’t have it, so there must be another way.