Need native support for VS Code through swupd

It’s pretty clear that we will never ship VS Code as a native bundle as part of Clear Linux. But what I am hoping is that we can put together a set of guidelines around 3rd party content and find ways for community members to maintain an easily installable bundle.

3 Likes

Continuing the discussion from Need native support for VS Code through swupd:

I had the same problem with flatpak, but recently found a pretty simple alternative though I don’t know if it will auto update. The integrated terminal seems to work perfectly however.

I downloaded the tar.gz from https://code.visualstudio.com/#alt-downloads

Extracted it with
tar -xf code-stable-*.tar.gz
Renamed it to something simpler
mv VSCode-linux-x64 vscode
then moved it to /opt/
sudo mv vscode /opt/

For it to show in applications follow these commands. I create the /usr/local/share/applications folder with mkdir cuz I didn’t have it and you might not either.
(You can use emacs or something else instead of vim if you like…).

mkdir /usr/local/share/applications
cd /usr/local/share/applications
sudo vim code.desktop

and type (change version to current one, at the time of writing the binary is version 1.39.2)

[Desktop Entry]
Encoding=UTF-8
Version=1.39.2
Type=Application
Terminal=false
Exec=/opt/vscode/code
Name=Visual Studio Code
Icon=/opt/vscode/resources/app/resources/linux/code.png

save the file and you’ll see it in your apps

Finally add it to path so you can do code workspace

cd /usr/local/bin
sudo ln -s /opt/vscode/code code

Hope it works for you as well :slight_smile:

6 Likes

This works and actually many proprietary softwares could run without major issues like this.

This is how I installed vscode. It works well enough, but the tgz doesn’t come with an updater, so you need to run through the whole process repeatedly if you want to keep up to date.

True. IntelliJ is one of the better citizens here. Their updater works flawlessly in my experience.

I suspect this would be key to increasing CL adoption (if that is a project goal - I’m not necessarily saying it ought to be). I have software from so many sources even in my relatively recent usage - CL bundles, flatpaks, proprietary installers, language-specific installers (go, rust, node). Most of those aren’t going to go away, but I’d particularly like to ditch the manual git-clone-and-builds, because of the update issue.

Recently swupd-client has a WIP pull-request for adding 3rd party support. It’s programmed in C and if you’re willing to you can help to facilitate this.

1 Like

I ‘know’ C in the way most non-C programmers do - ie. I gathered enough when learning programming to be able to read it but would be distinctly dangerous doing anything real with it.

You can avoid a potential conflict with swupd down the road by using /usr/local paths. For example, make sure environment variable XDG_DATA_DIRS contains /usr/local/share. Then you can create /usr/local/share/applications/code.desktop. Put your symlink to /opt/vscode/code in /usr/local/bin (or /opt/bin) and make sure it’s in your PATH.

1 Like

Thanks!! Did it already on mine, gonna edit the post.

Could clear use LXC like ChromeOS and Samsung Dex as a smart way of making more software available?

Google has done a lot of integration to ensure that LXC gives a good experience for end-users. We don’t have that in Clear Linux. We do have support for Docker and Kata Containers though, which should provide a lot of the same functionality.

Is there any progress on this? I can understand why the official repo from swupd won’t ever support proprietary packages but having a third party repo that uses the same swupd infrastructure with bundles that provide such packages would go a long away.

Other linux distro’s also go the same route, i.e. NixOS by default won’t allow any proprietary packages (also due to legal reasons) however you can easily toggle an allowUnfree option which allows you to install proprietary packages.

Yes, we hear you. We’re still working on implementing the capability to support 3rd party repos. You can follow the progress of the swupd client at https://github.com/clearlinux/swupd-client .

Is there any news on this topic ? I am new to CL and saw there is the 3rd-party sub-command for swupd.

I can’t figure out how to use it to install visual studio code tho…

You can download their tarball release, or comiple from VSCodium source code.

VSCodium works great, besides Flatpak there’s a Snap available too :

For CL you will have to compile snapd yourself first :
https://github.com/snapcore/snapd/archive/2.45.tar.gz

You can try 3-party repo mentioned in below link.

If we could mix this with this script that automates the download and update checking parts, it would be amazing. Something you could just call
./clos_vscode.sh { update | install } { where to install | folder containing the installation that will be updated }

I can do it, and I might do it eventually, but I suck at shell scripting, so it would take me a lot of time and it would still suck.

I’ve done something similar in my spare time for some applications I use often. You can check it at https://github.com/gaviriacc26/clear-apps.

There really is no update functionality, but reinstalling it with the updated resource (https://…) would do the trick. I usually keep them up to date. If one of them isn’t you could create an issue.

It would be great to development something much more robust as you suggest though.

I do something similar with

wget $(curl https://update.code.visualstudio.com/api/update/linux-rpm-x64/stable/latest| jq -r '.url')

However I do it manually because with rpm is is just a couple quick commands and code update are not usually that crucial in my case.