Clangd package missing error

I’ve encountered the same error today on Ubuntu 20.04, but unfortunately changing executable in preferences didn’t work for me.
However, I was able to make it work by hardcoding supported version of linux in installation script ( After

# get linux version
 if [ -x "$(command -v lsb_release)" ]; then
   LINUX_VERSION="$(lsb_release -a 2> /dev/null | grep Description | cut -f2)"

I’ve added line LINUX_VERSION="Ubuntu 18.04" (line 622 for me), uninstalled and installed Mbed again.
This works for me, i.e. error is not showing up and code completion works, but this may not work in all cases.

Script now downloads clangd binaries and some python script ( from and extracts them to ~/.config/Mbed Studio/mbed-studio-tools/clangd directory. Mbed seems to try using those binaries and doesn’t care about executable from preferences.

Possible improvements:

  1. Probably no need to run installation again, just download files manually and extract them in aforementioned directory.
  2. It uses binaries for 18.04 which seems to work for me (20.04) but may fail on other systems. In that case one could try installing clang and clangd for one’s system (sudo apt install ...) and replacing Mbed binaries with symlinks to system ones (ln -s /usr/bin/clangd clangd in ~/.config/Mbed Studio/mbed-studio-tools/clangd directory, same for clang-8) and leave python script as it is.

I haven’t tried those improvements and cannot confirm they work but they seem reasonable for me.

Also kudos to @gerriko for posting updates on his debugging process, there’s nothing more frustrating than seeing “it works now” as the only reply to question.

1 Like