ubuntu18.04更新clang的版本

这篇博客介绍了如何在Ubuntu 18.04上更新Clang的版本,包括添加bionic源,安装特定版本的Clang,以及配置选项。同时,还提及了在Ubuntu 20.4上安装Python 3.5的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(可选)添加bionic相关的源

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

添加配置选项

update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 200

update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 200

update-alternatives --config clang
update-alternatives --config clang++

install python 3.5 on ubuntu20.4

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值