Skip to content

Instantly share code, notes, and snippets.

@ivanitskiy
Forked from sergey-shambir/install-clang.sh
Created October 17, 2023 00:38
Show Gist options
  • Save ivanitskiy/5f6a1482bd3a21a9d093980005434462 to your computer and use it in GitHub Desktop.
Save ivanitskiy/5f6a1482bd3a21a9d093980005434462 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