As an extension to the other answers. Resolving the issue of non-existing libncurses5 and libtinfo5, after unpacking the ARM Embedded Toolchain.
Instead of symlinking to newer package version, actually install the expected package.
This even works for Ubuntu 24.04 where you cannot install the package using apt.
See which libraries that are missing
See the missing libraries with ldd (shared object dependencies):
ldd "$(which arm-none-eabi-gdb)"
Which outputs something similar to this. Observe the libraries marked with '=> not found'
        linux-vdso.so.1 (0x00007ffe6df20000)
        libncurses.so.5 => not found
        libtinfo.so.5 => not found
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f38ff7a8000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f38fe983000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f38fe89a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f38ff779000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f38ff774000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f38fe688000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f38ff7b4000)
Install the missing libraries
Get the packages from Ubuntu's own archive:
# libtinfo5
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.4-2_amd64.deb
libncurses5
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.4-2_amd64.deb
Then install the .deb packages using dpkg:
# libtinfo5
sudo dpkg -i ./libtinfo5_6.4-2_amd64.deb
libncurses5
sudo dpkg -i ./libncurses5_6.4-2_amd64.deb
Extra info about STM32CubeCLT
This also works for e.g. STM32CubeCLT - Command Line Tool which ships arm-none-eabi-gdb and which can detect that the wrong library version is used.
Example output if you have symlinked libncurses.so.5 to libncurses.so.6:
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.3.20021019' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.1.20000708' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.6.20061217' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.0.19991023' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libtinfo.so.5: version `NCURSES_TINFO_5.0.19991023' not found (required by arm-none-eabi-gdb)