Skip to main content
DQuir.1
Associate II
February 25, 2020
Solved

On ubuntu; debug says "Could not determine GDB version"

  • February 25, 2020
  • 19 replies
  • 40404 views

Could not determine GDB version using command: /opt/st/stm32cubeide_1.2.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.linux64_1.0.0.201904181610/tools/bin/arm-none-eabi-gdb --version

/opt/st/stm32cubeide_1.2.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.linux64_1.0.0.201904181610/tools/bin/arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

 

Best answer by mattias norlander

The error message suggests that your Ubuntu system is lacking libncurses. Try:

sudo apt-get install libncurses5

If that does not help. Let us know which Ubuntu version...

19 replies

Explorer II
February 11, 2025

Work for me: ubuntu 24.04 LTS:

- installed gdb-multiarch

- And as described :

sudo -i apt install gdb-multiarch # as mentioned before

cd /opt/st/stm32cubeide_1.15.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.100.202403111256/tools/bin # or wherever you installation is

mv arm-none-eabi-gdb arm-none-eabi-gdb.bak

ln -s /usr/bin/gdb arm-none-eabi-gdb

 - Work for me in a VM.

- Thank you for the help

Richard Lowe
Senior II
February 23, 2025

This solution doesn't seem to work for me.  All MCUs enter reset loop when used with the gdb that comes with gdb-multiarch. 

Screenshot From 2025-02-22 23-58-23.png

mladen
Associate II
March 25, 2025

This solution also doesn't work for me.I'm having same behavior as Richard.

My question would be what linux distribution is proven to work for STM32 tools?

AScha.3
Super User
March 25, 2025

Hi,

i have latest MxLinux , MX 23.5 Libretto;

STM32CubeIDE 1.18.0  : installed 1.18. amd64_deb_bundle  , working all fine - except : no debug, because still needs this 20 y old libs, libncurses.so5  or so, but after install gdb-multiarch (and making symlink) now fine.

And (until now) never crash or suddenly cannot open ioc /Cube file and hang up then, what happened with (my last) version 1.13.

AScha3_1-1742939061724.png

 

 

Some days ago needed CubeProgrammer, download en.stm32cubeprg-lin-v2-19-0, unzip, start install - ok. working.

AScha3_0-1742938883674.png

Here seems from install to running it all ok, no problems at all.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Visitor II
March 30, 2025

OS: 24.04.2 LTS (Noble Numbat)

STM32CubeIDE Version: 1.18.0


Steps:
1. arm-none-eabi-... installation:
- Download the Latest Release

x86_64 Linux hosted cross toolchains

AArch32 bare-metal target (arm-none-eabi)

arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz

https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

- Extract the Archive

tar -xf arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz

- Move It to /opt

sudo mv arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi /opt/arm-toolchain

- Add It to Your PATH

echo 'export PATH=/opt/arm-toolchain/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

 


2. libncurses5 installation - Solution from here:
https://askubuntu.com/questions/1531398/how-to-install-libncurses-so-5-for-ubuntu-24-04


https://stackoverflow.com/a/39840595
Add to source list and then install:

  • deb http://security.ubuntu.com/ubuntu focal-security main universe

    echo "deb http://security.ubuntu.com/ubuntu focal-security main universe" > /etc/apt/sources.list.d/ubuntu-focal-sources.list
  • sudo apt-get update

  • sudo apt-get install libncurses5

 

3. Nothing else done in preferences

Visitor II
April 1, 2025

My configuration : Ubuntu 24.10 /  STM32CubeIDE : 1.18.0.

After installing all the necessary packages for gdb and libncurses.so.6 (since libncurses.so.5 is not available with this version of Ubuntu), the workaround I found is to create a symbolic link for arm-none-eabi-gdb pointing to my local gdb: /usr/bin/arm-none-eabi-gdb.

 

you can follow this steps :

remove or just change the name of arm-none-eabi-gdb

sudo mv /opt/st/stm32cubeide_1.18.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/arm-none-eabi-gdb /opt/st/stm32cubeide_1.18.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/arm-none-eabi-gdb.org

 

create the Symbolic Link

sudo ln -s /usr/bin/arm-none-eabi-gdb /opt/st/stm32cubeide_1.18.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/arm-none-eabi-gdb

 


Explorer
April 9, 2025

Please tell us step by step for this process

 

Visitor II
April 9, 2025

For people using ubuntu 24.04, I am on ubuntu 24.04 x64. And I met same problem, following steps works for me.
step 1:
  wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
step 2:
  wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb
step3:
  sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb
step4:
  ls -l /lib/x86_64-linux-gnu/libncurses.so.5
You should see the output be like:
lrwxrwxrwx 1 root root 17 May 17 2023 /lib/x86_64-linux-gnu/libncurses.so.5 -> libncurses.so.5.9

Explorer
April 9, 2025

after this what can i do?

 

Visitor II
April 9, 2025

Hi, the problem should be solved, you can try debug with your chip.

mladen
Associate II
April 12, 2025

Hi !

I have solve the problem in another way.And it wasn't working before. You can see my previous post, that I had problems also. I was frustrated and complettely removed STM32CubeIDE but I after saw post from Zhe-WANG, decided to try again.
Then I remembered that I have read about below descibed trick with pausing somewhere, but before I was only install package with jlink rules, but didn't relized that I have libncurses5 and libtinfo5 there. :)

I'm using latest Linux Mint Linux Mint 22.1 Cinnamon which is based on Ububtu 24.04. 

Download latest CubeIde script installation file.  Mine was stm32cubeide_1.18.0_24413_20250227_1633_amd64.deb_bundle.sh

Start installation in command line bt sudo sh ./stm32cubeide_1.18.0_24413_20250227_1633_amd64.deb_bundle.sh

During the installation of STM32Cube, when prompted for installing JLink rules, STOP and go to your installation folder.
There would be new folder (locked by installation) which contain all installation files including 
libncurses5_6.4-2_amd64.deb
libtinfo5_6.4-2_amd64.deb, which are version 5 what we need.
and segger-jlink-udev-rules-8.12c_final-linux-all.deb
For some reason installation script is not installing them.
You need to get into that folder by getting it as root, and to save all files somewhere else. Very important since installation will remove it.
Since you have this files saved, continue installation as normal.

When all is finished, install this deb files mentioned above with dpgk -i command.

When I installed this, STM32CubeIDE is not complaing about "Can't find GDB" and debugging is working.

mladen_0-1744418787797.png


Hope this help.

Associate
June 11, 2025

I've had the same issue, but when I run the command "sudo apt-get install libncurses5" I get the error message "Unable to locate package libncurses5". The debug ran correctly once, then promted for an update. After I updated it and tried to run it again I got this error message. I am using the USB connection CN15 labelled ST-LINK on a NUCLEO-WB55RG evaluation board. My version of Ubuntu is 24.04

Associate
June 26, 2025

libncurses5 was removed in Ubuntu 24.04. Try

curl -O http://launchpadlibrarian.net/648013227/libncurses5_6.4-2_amd64.deb

sudo dpkg -i libncurses5_6.4-2_amd64.deb

Associate
August 2, 2025

I was using Arch Linux. I had install the following package:

yay -S ncurses5-compat-libs
Visitor II
September 10, 2025

I am on Ubuntu 25.04, and I solved this problem by first installing gdb-multiarch.

sudo apt-get install gdb-multiarch

I had to do this because the arm-none-eabi-gdb binary included with the latest version of CubeIDE relies on libncurses.so.5, which Ubuntu 25.04 no longer supports. To solve this, you have to replace said binary with a symlink to gdb-multiarch. "Multiarch" stands for "multiple architectures", so it includes the arm-none-eabi stuff. This can be accomplished in a few commands:

cd /opt/st/stm32cubeide_1.19.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin
sudo rm arm-none-eabi-gdb
sudo ln -s /usr/bin/gdb-multiarch arm-none-eabi-gdb

The directory in the first command can be found by opening the IDE, and clicking Window -> Preferences -> STM32 Cube -> Toolchain Manager. I restarted the IDE and debugging started working.