How to enable Software Collections (SCL) on CentOS)

Source: Internet
Author: User

How to enable Software Collections (SCL) on CentOS)

Red Hat Enterprise Linux (RHEL) and CentOS, its community branch, provide a 10-year life cycle, meaning that each version of RHEL/CentOS will provide security updates for up to 10 years. Although such a long life cycle provides enterprise users with much-needed system compatibility and reliability, there is also a drawback: as the underlying RHEL/CentOS version approaches the end of the life cycle, core applications and runtime environments become obsolete. For example, in CentOS 6.5, the end time of its lifecycle is November 30, 2020, and the Python 2.6.6 and MySQL 5.1.73 carried by it are very old by today's standards.

On the other hand, attempts to manually upgrade the development tool chain and runtime environment on RHEL/CentOS may cause system crashes unless all dependencies are properly resolved. Generally, manual upgrades are not recommended unless you know what you are doing.

SCL

The Software Collections source has emerged to help solve this problem in RHEL/CentOS. The creation of the SCL is to provide RHEL/CentOS users with multiple (and possibly updated) versions for convenient and secure installation and use of applications and runtime environments, at the same time, avoid messing up the system. The third source may conflict with the installed packages.

The latest SCL provides:

  • Python 3.3 and 2.7
  • Python 5.4
  • Node. Javascript 0.10
  • Ruby 1.9.3
  • Perl 5.16.3
  • MariaDB and MySQL 5.5
  • Apache httpd 2.4.6

In the rest of this tutorial, I will show you how to configure the SCL source and how to install and enable the packages in the SCL.

 

Configure the SCL Source

The SCL can be used for CentOS 6.5 and later versions. To configure the SCL source, run the following command:

  1. $ sudoyum install centos-release-SCL

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

  1. $ sudoyum install scl-utils-build

Run the following command to view the complete list of available packages in the SCL:

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

 

Install and enable a package from the SCL

Now that you have configured the check box, you can continue and install the check box from the check box.

You can search for the packages in the SCL:

  1. $ yum--disablerepo="*"--enablerepo="scl" search <keyword>

Suppose you want to install Python 3.3.

Continue, use yum for installation as usual in the installation package:

  1. $ sudoyum install python33

You can view the list of packages installed from the SCL at any time, just execute:

  1. $ scl --list
  2. python33

One of the advantages of SCL is that the package will not overwrite any system files, and it will not cause conflicts with its inventory library and Application in the system.

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

  1. $ python --version
  2. Python2.6.6

If you want to use an installed SCL package, you need to usesclCommand to enable it explicitlysclCommand)

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

For examplepythonCommand to enable the python33 package:

  1. $ scl enable python33 'python --version'
  2. Python3.3.2

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

  1. $ scl enable python33 bash

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

In short, you have a virtual environment like Python, but it is more common, because you can enable/disable an SCL session for more apps than Python.

For more details, refer to the official Quick Start Guide.

L

Author: Dan Nanni Translator: bianjp Proofreader: wxy

This article was originally compiled by LCTT and launched with the honor of Linux in China

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.