It just hangs like in an infinite loop. Any suggestions?

You don't know whether it's waiting for something or is actually in infinite loop.

Your first steps should be:

  1. Run top and see whether GDB process is consuming CPU or is increasing in memory and
  2. Run strace gdb to see which (if any) system calls it is performing.

With that info, further guesses could be made. It may also help to know which system you are on, and which version of GDB you have installed.

Update:

Running strace gdb results in a infinite loop outputting: readlink(“/usr/bin/python”, “python”, 4096) = 6

So you have /usr/bin/python which is a symlink to itself.

Yes, that would cause all kinds of problems (including not being able to actually run python from command line).

Remove that symlink (/usr/bin/python is supposed to point to python2 or python3).

Answer from Employed Russian on Stack Overflow
🌐
Quora
quora.com › How-do-you-install-arm-none-Eabi-GDB-on-Ubuntu-20-04-LTS-Focal-Fossa-apt-gcc-arm-Ubuntu
How to install arm none Eabi GDB on Ubuntu 20.04 LTS (Focal Fossa, apt, gcc, arm, Ubuntu) - Quora
Answer: Hi, typically you can download the ARM GNU Tool chain directly from ARM. This tool chain can be found here, be sure to select the correct download for your personal computers’ architecture.
Discussions

installing gdb version 14
As you can see here , Ubuntu 23.04 provides GDB 13. If you want GDB 14, you need to upgrade to 23.10. Regardless, you need to upgrade to 23.10 anyway, because 23.04 has reached end of life and isn't being updated anymore. See here . More on reddit.com
🌐 r/Ubuntu
1
1
March 18, 2024
Uninstalled GDB; apt had an absolute meltdown
so everyone I fixed the problem; apologies for not updating the post. kinda forgot. anyway, turns out, everything should've worked fine. it wasn't an issue with GDB ruining my system. it was the fact that, for some reason, my apt repositories completely changed and confused the living hell out of apt whenever I ran my first apt update I had the same issue appear again after I completely reinstalled my OS and, after uncommenting the correct repositories, I didn't even need to compile GDB from scratch considering the distro provided one (not gdb-minimal) worked perfectly. all that hair-ripping and loss of my customizations could've been fixed by a simple view at the /etc/apt/sources.list file lmao, but my system looks better now after the second round of customizing it from scratch so I'm atleast grateful for that thank you for the help everyone :) More on reddit.com
🌐 r/linuxquestions
2
3
January 15, 2022
amd Rocm installation problem
"depends on .... but it's not installable" That means it's part of a repository which is not (yet) enabled. I believe they are part of the 'Universe' repository. You'll need to enable that. To add the universe repository: sudo add-apt-repository universe After that, just for good measure clean the cache sudo apt-get clean After that update it sudo apt-get update And from that point follow the AMD guide. More on reddit.com
🌐 r/Ubuntu
1
2
January 12, 2024
Seer – a GUI front end to GDB for Linux
FINALLY A GUI DEBUGGER AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *explodes in excitement* Yes this is valid because it seems CLI is king, but certainly not the king of usability. A GUI is VERY MUCH APPRECIATED. Yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay! More on reddit.com
🌐 r/linux
41
317
October 3, 2022
🌐
Gdbtutorial
gdbtutorial.com › tutorial › how-install-gdb
How to Install GDB? | GDB Tutorial
You can install gdb on Debian-based linux distro (e.g. Ubuntu, Mint, etc) by following command.$ sudo apt-get update $ sudo apt-get install gdb
🌐
Ubuntu
documentation.ubuntu.com › snapcraft › stable › how-to › debugging › debug-with-gdb
Debug with GDB - Snapcraft 8.13.2 documentation
Most snaps don’t ship with apps that include debug symbols. While GDB can be used without debug symbols, debugging is more difficult because function names, variable names, and source code won’t be available. To use GDB effectively, you need to build and install the snap locally with debug ...
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-newbie-8 › install-gdb-in-linux-904831
install gdb in Linux
September 24, 2011 - Hi, I need gdb but when I run gdb command I get the following error: bash: gdb: command not found Could you please tell me what should I do to fix
🌐
MoldStud
moldstud.com › articles › developers faq › ubuntu developers questions › best practices for using gdb on ubuntu - a comprehensive developer handbook
Best Practices for Using GDB on Ubuntu - A Comprehensive Developer Handbook
March 15, 2025 - The integration of custom scripts can create automation for common debugging scenarios, helping focus efforts on complex issues rather than mundane commands. Install GDB using the command: sudo apt install gdb.
Find elsewhere
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 9 › html › user_guide › chap-gdb
Chapter 8. GNU Debugger (GDB) | User Guide | Red Hat Developer Toolset | 9 | Red Hat Documentation
# debuginfo-install glibc Loaded plugins: product-id, refresh-packagekit, subscription-manager --> Running transaction check ---> Package glibc-debuginfo.x86_64 0:2.17-105.el7 will be installed ... Copy to Clipboard Copied! ... Copy to Clipboard Copied! ... This starts the gdb debugger in interactive mode and displays the default prompt, (gdb).
🌐
Linux From Scratch
linuxfromscratch.org › blfs › view › svn › general › gdb.html
GDB-16.3
If you have built the API documentation, it is now in gdb/doc/doxy. You can install it (as the root user):
🌐
GitHub
gist.github.com › richyliu › e9ec03f455bee86dc407b7e051245c0e
Building GDB on Ubuntu 20.04 · GitHub
Building GDB on Ubuntu 20.04 · Raw · build_steps.sh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
STMicroelectronics Community
community.st.com › t5 › stm32cubeide-mcus › on-ubuntu-debug-says-quot-could-not-determine-gdb-version-quot › td-p › 244902 › page › 3
Solved: On ubuntu; debug says "Could not determine GDB ver... - Page 3 - STMicroelectronics Community
September 10, 2025 - Version 5 is not even on option in my Mint/Ubuntu 22 Kernel 6.8 distribution. I finally resulted begrudgingly, to drop back to windows. Good Luck All. ... Object-Option not available in my distribution. ... Your "ugly" workaround still much better than the ST "work" - still using the 12 year old libncurses5 . (That can be installed no more ... apt get responds : : No installation candidate exists for package 'libncurses5'. ) So with gdb-multiarch IDE 1.17.0 has working debug again...great job !
🌐
Ubuntu
launchpad.net › ubuntu › +source › gdb
gdb package : Ubuntu
gdb: GNU Debugger gdb-dbgsym: debug symbols for gdb gdb-doc: The GNU Debugger Documentation gdb-minimal: GNU Debugger (minimal version - dummy transitional package) gdb-multiarch: GNU Debugger (with support for multiple architectures) gdb-multiarch-
🌐
Ubuntu
manpages.ubuntu.com › manpages › jammy › man1 › gdb.1.html
Ubuntu Manpage: gdb - The GNU Debugger
The full documentation for GDB is maintained as a Texinfo manual. If the "info" and "gdb" programs and GDB's Texinfo documentation are properly installed at your site, the command info gdb should give you access to the complete manual.
🌐
Reddit
reddit.com › r/ubuntu › installing gdb version 14
r/Ubuntu on Reddit: installing gdb version 14
March 18, 2024 -

Im currently on ubuntu version 23.04 and I have gdb version 13.1 and i need to upgrade to 14.2 however whenever I do apt update gdb doesnt update and i tried to manually install gdb 14.2 but there are no clear instructions on how to go about it. any help would be appreciated

(ps. im new to linux)

🌐
Taufan Lubis
taufanlubis.wordpress.com › 2020 › 06 › 07 › docker-tutorial-how-to-install-gdb-gnu-debugger-in-docker-container
Docker tutorial – How to install GDB (gnu Debugger) in Docker container? | Taufan Lubis - Ubuntu Linux
June 7, 2020 - darklinux@darklinuxpc:~$ sudo docker run -it --name ubuntu-gdb --cap-add=SYS_PTRACE --security-opt seccomp=unconfined ubuntu:bionic /bin/bash root@97d2ea802bfe:/# apt-get update > null root@97d2ea802bfe:/# apt-get -y install gdb > null debconf: ...
🌐
LinuxConfig
linuxconfig.org › home › how to install gdb in rhel 8
Install gdb on RHEL 8: Step-by-Step Guide
September 22, 2025 - Learn to install gdb on RHEL 8 and debug C programs using breakpoints. Get step-by-step guidance on using gdb effectively.
🌐
Howtoinstall.me
howtoinstall.me › ubuntu › 18-04 › gdb
How to Install gdb in Ubuntu 18.04
Ubuntu · 18.04 · gdb · Install gdb by entering the following commands in the terminal: sudo apt update sudo apt install gdb · Description: GNU Debugger · GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where ...
🌐
VITUX
vitux.com › how-to-use-gdb-to-debug-programs-in-ubuntu
How to Use GDB to Debug Programs in Ubuntu 20.04 – VITUX
February 19, 2021 - In this article, we explore how to debug C programs using GDB in Ubuntu 20.04 LTS (Focal Fossa). ... User with sudo privileges for renaming multiple files. Note: The commands discussed in this article have been tested on Ubuntu 20.04 LTS (Focal Fossa). Install prerequisite GN packages for compiling and debugging.
🌐
Ubuntu
manpages.ubuntu.com › manpages › xenial › man1 › gdbserver.1.html
Ubuntu Manpage: gdbserver - Remote Server for the GNU Debugger
The full documentation for GDB is maintained as a Texinfo manual. If the "info" and "gdb" programs and GDB's Texinfo documentation are properly installed at your site, the command info gdb should give you access to the complete manual.