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:
$ sudoyum install centos-release-SCL
To enable and run the application in the SCL, you also need to install the following packages:
$ sudoyum install scl-utils-build
Run the following command to view the complete list of available packages in the SCL:
$ 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:
$ 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:
$ sudoyum install python33
You can view the list of packages installed from the SCL at any time, just execute:
$ scl --list
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:
$ python --version
Python2.6.6
If you want to use an installed SCL package, you need to usescl
Command to enable it explicitlyscl
Command)
$ scl enable <scl-package-name><command>
For examplepython
Command to enable the python33 package:
$ scl enable python33 'python --version'
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:
$ scl enable python33 bash
In this bash Session, the default python version will be switched to version 3.3 until you enterexit
To 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: