1. 备份/etc/apt/sources.list
2. 添加源到sources.list文件最后
sudo vim /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe
3. 更新源
sudo apt update
安装相关版本的clang
sudo apt install clang-6.0
or
sudo apt install clang-9