Skip to content

Instantly share code, notes, and snippets.

@Letterus
Last active October 16, 2022 11:34
Show Gist options
  • Save Letterus/46ba248b064f789c0cce91b271b1a96d to your computer and use it in GitHub Desktop.
Save Letterus/46ba248b064f789c0cce91b271b1a96d to your computer and use it in GitHub Desktop.
Install clang stable (14) on Debian Stable (Bullseye)
#!/bin/bash
wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main
deb-src [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main" | sudo tee /etc/apt/sources.list.d/clang.list
sudo apt update
sudo apt-get install clang-14 clang-tools-14 clang-14-doc libclang-common-14-dev libclang-14-dev libclang1-14 clang-format-14 python3-clang-14 clangd-14 clang-tidy-14 lldb-14 lld-14
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 140 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-14 --slave /usr/share/man/man1/clang.1.gz clang.1.gz /usr/share/man/man1/clang-14.1.gz --slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 --slave /usr/bin/clang-format clang-format /usr/bin/clang-format-14 --slave /usr/bin/clangd clangd /usr/bin/clangd-14udo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 140
sudo update-alternatives --config cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment