如何在同一台计算机(ubuntu)上同时安装多个版本的llvm libc++?

如何在同一台计算机(ubuntu)上同时安装多个版本的llvm libc++?

我已经尝试过显而易见的方法:

apt-get install -y clang++-7 libc++abi-7-dev libc++-7-dev
apt-get install -y clang++-8 libc++-8-dev libc++abi-8-dev
apt-get install -y clang++-9 libc++-9-dev libc++abi-9-dev
apt-get install -y clang++-10 libc++-10-dev libc++abi-10-dev

clang++ 有多个版本都没问题。但是 libc++ 每次更新都会卸载之前的版本。

当我尝试时:

apt-get install libc++abi-7-dev libc++-7-dev  libc++abi-8-dev libc++-8-dev libc++-9-dev libc++abi-9-dev libc++-10-dev libc++abi-10-dev

我明白了

The following packages have unmet dependencies:
 libc++-10-dev : Conflicts: libc++-x.y-dev
 libc++-7-dev : Depends: libc++1-7 (= 1:7.0.1-12) but it is not going to be installed
                Conflicts: libc++-x.y-dev
 libc++-8-dev : Depends: libc++1-8 (= 1:8.0.1-9) but it is not going to be installed
                Conflicts: libc++-x.y-dev
 libc++-9-dev : Depends: libc++1-9 (= 1:9.0.1-11ubuntu1) but it is not going to be installed
                Conflicts: libc++-x.y-dev
 libc++abi-10-dev : Conflicts: libc++abi-x.y-dev
 libc++abi-7-dev : Depends: libc++abi1-7 (= 1:7.0.1-12) but it is not going to be installed
                   Conflicts: libc++abi-x.y-dev
 libc++abi-8-dev : Depends: libc++abi1-8 (= 1:8.0.1-9) but it is not going to be installed
                   Conflicts: libc++abi-x.y-dev
 libc++abi-9-dev : Depends: libc++abi1-9 (= 1:9.0.1-11ubuntu1) but it is not going to be installed
                   Conflicts: libc++abi-x.y-dev
E: Unable to correct problems, you have held broken packages.

现在我在 ubuntu 20.04 上尝试这个,但我在以前版本的 Ubuntu 上也尝试过类似的操作,遇到了基本相同的问题。

相关内容