#VSCode – Installing Visual Studio Code in a #RaspberryPi, a couple of lessons learned – @code

Hi!

Now that I have my amazing Raspberry Pi 4 with 4GB RAM, it’s time to see how serious the device is. So, I decided to install and use some developers’ tools in the RPi. My dev list will be something like this

  • Python
  • Some ML and AI Python packages
  • GIT
  • Arduino
  • Visual Studio Code

It’s been a while since I installed VSCode in the device. The last time I did this, I needed to download the code from GitHub and compile the tool in the Raspberry Pi. As far as I remember this was a +25 min process.

Lucky for us the process can now be much simpler, thanks to Headmelted (see references). Now, we only need a single command to install VSCode:

. <( wget -O -
https://code.headmelted.com/installers/apt.sh )

Install process started! Or Maybe not because I found this amazing GPG error

python error installing visual studio code in raspberry pi
pi@rpidev3:~ $ curl -L https://code.headmelted.com/installers/apt.sh | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2349 0 2349 0 0 19739 0 --:--:-- --:--:-- --:--:-- 19906
Detecting architecture…
Ensuring curl is installed
Reading package lists… Done
Building dependency tree
Reading state information… Done
curl is already the newest version (7.64.0-4).
The following packages were automatically installed and are no longer required:
python3-pyperclip python3-thonny rpi.gpio-common
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Architecture detected as armv7l…
Retrieving GPG key headmelted
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
gpg: no valid OpenPGP data found.
Removing any previous entry to headmelted repository
Installing [headmelted] repository…
Updating APT cache…
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease [23.4 kB]
Err:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
Reading package lists…
W: GPG error: https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
E: The repository 'https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease' is not signed.
Done!
Repository install complete.
Installing Visual Studio Code from [stretch]…
Reading package lists… Done
E: The value 'stretch' is invalid for APT::Default-Release as such a release is not available in the sources
Visual Studio Code install failed.

There a public GPG key used to verify the package and the SH script somehow does not download it (I think the ARM RPI version is still not defined). So, before the previous command, I need to run this command

wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O
- | sudo apt-key add –

Now we have Visual Studio Code installed!

raspberry pi visual studio code installed

But, yes another but, you may note that the tool open and display a black window. Again, I need to go deeper on the details, but the latest version does not work well. There is some context information on GitHub (see references), and the proposed solution is to rollback to a previous version

sudo apt-get install code-oss=1.29.0-1539702286

And we also need to disable the automatic updates on this tool

sudo apt-mark hold code-oss

And now, yes, we got a fully functional Visual Studio Code in our Raspberry Pi!

Happy Coding!

Greetings @ Toronto

El Bruno

References

Advertisements

6 thoughts on “#VSCode – Installing Visual Studio Code in a #RaspberryPi, a couple of lessons learned – @code”

  1. Dear Sir,
    First of all, I want to thank you about your blog about object detection using YOLO. Thereafter, I’m a beginner in AR, VR and I want to try deploy an example of object detection on HoloLens using YOLO. Therefore, can you please give me some details about the instructions to deploy the YOLO library to Unity to HoloLens. Certainly, I will be among the most followers of your blogs. Thank you for helpfulness.
    Best regards

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.