Skip to content

Instantly share code, notes, and snippets.

@101arrowz
Created June 29, 2026 20:51
Show Gist options
  • Select an option

  • Save 101arrowz/18aca40fcb29aadb8b369540fb28565e to your computer and use it in GitHub Desktop.

Select an option

Save 101arrowz/18aca40fcb29aadb8b369540fb28565e to your computer and use it in GitHub Desktop.
update-alternatives for apt.llvm.org
VERSION="22"
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-$VERSION/bin/clang 100 $(ls -1 /usr/lib/llvm-$VERSION/bin | grep -vE '\-'$VERSION'(\.[0-9]+)*$' | grep -vE '^clang$' | awk '{print "--slave", "/usr/bin/" $1, $1, "/usr/lib/llvm-'$VERSION'/bin/" $1}' | tr '\n' ' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment