Goodbye to Flathub

Flatpak format is being touted to be a robust way of doing package management (list available, install, update, remove etc.) in Linux systems for quite some time. I tried Snap packages from Canonical (the makers of Ubuntu) a while ago but didn't use it after that one attempt (I don't even remember what I installed using it).

Just as all packages one installs using apt (It is what you can use in place of the long known apt-get!) come from APT software repositories stored in a remote server, Flatpak packages come from Flathub (the official repository). I thought of giving the Flathub/Flatpak ecosystem a try by using it to obtain FOSS (Free and Open Source Software) build of Microsoft's VSCode.

The installation was smooth and I really liked writing content for this blog ina Markdown supported editor (with Live preview provided by an add-on) as well as using Bash terminal right from the bottom. However I found out that I can't execute certain command line tools due to the Sandboxing model of Flatpak installations. In particular, my roadblock is similar to that of the reporter for this issue. So I resorted to a workaround of this form.

In my Ubuntu system, the application launcher uses .desktop files to create clickable shortcuts for applications. I found that the relevant file to edit in my current situation is com.visualstudio.code.oss.desktop. This is what I made it look like:

[Desktop Entry]
Name=Visual Studio Code - OSS
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/var/lib/flatpak/app/com.visualstudio.code.oss/x86_64/stable/active/files/share/code-oss/code-oss --unity-launch @@ %F @@
Icon=com.visualstudio.code.oss
Type=Application
StartupNotify=false
StartupWMClass=Code - OSS
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;
X-Flatpak=com.visualstudio.code.oss

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/var/lib/flatpak/app/com.visualstudio.code.oss/x86_64/stable/active/files/share/code-oss/code-oss --new-window @@ %F @@
Icon=com.visualstudio.code.oss

I only edited the 2 Exec lines and saved it. Doing this, I could overcome the sandboxing model and just use the system binaries directly from the integrated teminal in VSCode thereafter.

However, with every update to VScode, provided via Flatpak system, my modifications got replaced and I had to re-apply the same fix over and over. This became a pain as I had to keep updating this script for Gnome Application launcher shortcuts to work.

I finally gave up and started considering building from source myself. However the notes and comments here and here took me to consider following this barebones project instead.

As pointed to from the README.md of the above project, I proceeded to embrace this project.

By the time this post was done, I finished removing the existing Flathub provided VSCode and installed the new VSCodium! I'm writing this paragraph from the new installation and I'm very happy with what I received. The process of installing VSCodium has been frictionless and now I can just use the integrated terminal! No more sandbox non-sense to deal with.

Head over to the official README for installation instructions. Thank the developer Pavlo Rudyi for the efforts!

links

social