Enable Software Set Software Collections (SCL) on CentOS

SCL Introduction

  • Red Hat Enterprise linux (RHEL) and its Community Edition branch --CentOS, 10-year life cycle, which means that each version of RHEL / CentOS will provide up to 10 years of security updates. While such a long life cycle of enterprise users with a system compatibility and reliability urgently needed, but there is one drawback: With the bottom of the RHEL / CentOS version near the end of the life cycle, core applications and run-time environment has become obsolete obsolete.

  • On the other hand, in the RHEL / CentOS try to manually upgrade development tool chain and runtime environment there is the potential for a system crash.

  • Software Collections (SCL) source appeared to help solve this problem in RHEL / CentOS. SCL was created to provide a convenient and more secure when installing and using the application and the operating environment (and may be updated) version of the way, while avoiding messing up the system. As opposed to third-party sources, which may cause a conflict between installed packages.

Configuration SCL source

SCL can be used for CentOS 6.5 and later. To configure the SCL source, simply execute:

$ sudo yum install centos-release-SCL

To enable the SCL and run applications, you also need to install the following packages:

$ sudo yum install scl-utils-build

Execute the following command to view a complete list of available packages SCL:

$ yum --disablerepo="*" --enablerepo="scl" list available

Install and enable package from the SCL

Search SCL package, installation is assumed Python 3.3:

$ yum --disablerepo="*" --enablerepo="scl" search python33

Continue as usual as the installation package using yum install:

$ sudo yum install python33
看从 SCL 中安装的包的列表
$ scl --list:

One of the advantages of SCL package which is installed not overwrite any system files, and guaranteed not to conflict with other applications and systems in libraries.

For example, if the default python version check after installation python33 package, you will find that the default version has not changed:

$ python --version

Python 2.6.6

If you want to use a SCL package already installed, you need to use scl command in each command explicitly enable it (LCTT translation: SCL want to use the package in which of the command, you have to execute the command by command scl)

$ scl enable <scl-package-name> <command>

For example, to enable python33 package for python command:

$ scl enable python33 'python --version'

If you want to execute multiple commands when you enable python33 package, so you can create a bash session to enable the SCL as follows:

$ scl enable python33 bash

In this bash session, the default python will be switched to the 3.3 version, until you enter exit, exit the session.

In short, SCL sort of virtual environments like Python, but more versatile because you can enable / disable the SCL session for more than Python applications.

SCL more detailed guidelines, consult the official Quick Start Guide

Published 27 original articles · won praise 3 · Views 1263

Guess you like

Origin blog.csdn.net/qq_39609993/article/details/105117947