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
Step 1: Update and Refresh Repository Lists
Open a terminal window, and enter the following:
sudo apt update
Step 2: Install Supporting Software
The software-properties-common package gives you better control over your package manager by letting you add PPA (Personal Package Archive) repositories. Install the supporting software with the command:
sudo apt install software-properties-common
install additional software for python
Step 3: Add Deadsnakes PPA
Deadsnakes is a PPA with newer releases than the default Ubuntu repositories. Add the PPA by entering the following:
sudo add-apt-repository ppa:deadsnakes/ppa
The system will prompt you to press enter to continue. Do so, and allow it to finish. Refresh the package lists again:
sudo apt update
Step 4: Install Python 3
Now you can start the installation of Python 3.8 with the command:
sudo apt install python3.8
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
Then run :
sudo update-alternatives --config python