AVR Debug error: libncurses.so.5

Hello,

I am new to PlatformIO and wanted to try out debugging an Arduino Nano.
I installed PIO in VSCode (Ubuntu 22.04), created a project and followed the debugging documentation. However, I am running into the following error:

.platformio/packages/toolchain-atmelavr/bin/avr-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

I have been researching this for about an hour, and have followed several fixes (e.g. this and this, but nothing works.

Can someone perhaps suggest a solution?

After some more digging, I figured to install the .deb package of VSCode instead of the flatpack. After making python3-venv, so that VSCode could find the interpreter, I reinstalled PIO and I did not get any more errors.

I had the same issue on Ubuntu 24.04 and did have the deb package installed as per MS documentation: Running Visual Studio Code on Linux

I resolved the issue by creating two symlinks:

sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6.4 /usr/lib/x86_64-linux-gnu/libncurses.so.5

I tried a dozen solutions to get the v5 files, but none of them worked.

After several attempts this worked perfectly on ubuntu Ubuntu 24.04.1