Skip to content

Instantly share code, notes, and snippets.

@sergey-shambir
Last active November 20, 2023 10:16
Show Gist options
  • Save sergey-shambir/c2759c6d4ccb943743b2654b2fa6a567 to your computer and use it in GitHub Desktop.
Save sergey-shambir/c2759c6d4ccb943743b2654b2fa6a567 to your computer and use it in GitHub Desktop.
install clang on Debian 9
# Add apt.llvm.org repository and install clang
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main"
sudo apt-get update
sudo apt-get install -y clang clang-format clang-tidy lldb libc++-8-dev libc++abi-8-dev
# Check version
clang --version
clang++ --version
# Use clang as default compiler
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 90
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 90
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++ 90
# Check default compiler tools
cc --version
c++ --version
cpp --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment