centos 使用 scl 软件集

os: centos 7.4

yum repolist

之前已经安装了 epel

# yum repolist

repo id                                               repo name                                                                       status
base/7/x86_64                                         CentOS-7 - Base                                                                 10,097
epel/x86_64                                           Extra Packages for Enterprise Linux 7 - x86_64                                  13,490
extras/7/x86_64                                       CentOS-7 - Extras                                                                  305
updates/7/x86_64                                      CentOS-7 - Updates                                                                 997

yum install scl

# yum install centos-release-scl centos-release-scl-rh

# yum repolist

repo id                                               repo name                                                                       status
base/7/x86_64                                         CentOS-7 - Base                                                                 10,097
centos-sclo-rh/x86_64                                 CentOS-7 - SCLo rh                                                               8,770
centos-sclo-sclo/x86_64                               CentOS-7 - SCLo sclo                                                               869
epel/x86_64                                           Extra Packages for Enterprise Linux 7 - x86_64                                  13,490
extras/7/x86_64                                       CentOS-7 - Extras                                                                  305
updates/7/x86_64                                      CentOS-7 - Updates                                                                 997

可以看到已经有 centos-sclo-rh、centos-sclo-sclo 的源了

安装某个 scl 软件包

# yum list all |grep -i scl-util
scl-utils.x86_64                           20130529-17.el7_1      @anaconda     
scl-utils.x86_64                           20130529-19.el7        base          
scl-utils-build.x86_64                     20130529-19.el7        base

# yum install scl-utils scl-utils-build

# yum --disablerepo='*' --enablerepo='centos-sclo-rh' list available

# yum --disablerepo='*' --enablerepo='centos-sclo-sclo' list available

查看从 scl 安装的软件包

# scl --list

安装某个 scl 软件包,都是 centos-sclo-rh 源

# yum install llvm-toolset-7

============================================================================================================================================
 Package                                      Arch                   Version                           Repository                      Size
============================================================================================================================================
Installing:
 llvm-toolset-7                               x86_64                 5.0.1-4.el7                       centos-sclo-rh                 3.9 k
Installing for dependencies:
 devtoolset-7-binutils                        x86_64                 2.28-11.el7                       centos-sclo-rh                 5.3 M
 devtoolset-7-gcc                             x86_64                 7.3.1-5.16.el7                    centos-sclo-rh                  29 M
 devtoolset-7-gcc-c++                         x86_64                 7.3.1-5.16.el7                    centos-sclo-rh                  11 M
 devtoolset-7-libstdc++-devel                 x86_64                 7.3.1-5.16.el7                    centos-sclo-rh                 2.5 M
 devtoolset-7-runtime                         x86_64                 7.1-4.el7                         centos-sclo-rh                  20 k
 llvm-toolset-7-clang                         x86_64                 5.0.1-4.el7                       centos-sclo-rh                 545 k
 llvm-toolset-7-clang-libs                    x86_64                 5.0.1-4.el7                       centos-sclo-rh                  13 M
 llvm-toolset-7-compiler-rt                   x86_64                 5.0.1-2.el7                       centos-sclo-rh                 1.7 M
 llvm-toolset-7-libomp                        x86_64                 5.0.1-2.el7                       centos-sclo-rh                 246 k
 llvm-toolset-7-lldb                          x86_64                 5.0.1-4.el7                       centos-sclo-rh                 5.0 M
 llvm-toolset-7-llvm                          x86_64                 5.0.1-8.el7                       centos-sclo-rh                 2.6 M
 llvm-toolset-7-llvm-libs                     x86_64                 5.0.1-8.el7                       centos-sclo-rh                  13 M
 llvm-toolset-7-python2-lit                   noarch                 0.5.1-1.el7                       centos-sclo-rh                  99 k
 llvm-toolset-7-runtime                       x86_64                 5.0.1-4.el7                       centos-sclo-rh                 1.1 M

Transaction Summary
============================================================================================================================================
Install  1 Package (+14 Dependent packages)



# scl --list
devtoolset-7
llvm-toolset-7

切换版本

# scl enable llvm-toolset-7 bash

# source /opt/rh/llvm-toolset-7/enable 

# lldb -version
lldb version 5.0.1

# which clang
/opt/rh/llvm-toolset-7/root/usr/bin/clang

# clang --version                   
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rh/llvm-toolset-7/root/usr/bin

clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rh/llvm-toolset-7/root/usr/bin

参考:
https://linux.cn/article-6776-1.html
https://www.softwarecollections.org/en/docs/

发布了710 篇原创文章 · 获赞 70 · 访问量 49万+

猜你喜欢

转载自blog.csdn.net/ctypyb2002/article/details/103599408