CentOS에서 IUS 및 SCL을 활용한 최신 소프트웨어 설치 방법

IUS를 통한 최신 소프트웨어 설치

CentOS 공식 저장소의 패키지 버전이 오래되어, 일반적으로 사용자들이 소스 코드를 직접 다운로드해 컴파일하는 경우가 많다. 이를 방지하기 위해 레드햇 공식 제공인 Software Collections (SCL)과 커뮤니티 기반의 IUS를 활용할 수 있다.

IUS 개요

IUS(Inline with Upstream Stable)는 오픈소스 커뮤니티가 운영하는 저장소로, 공식 웹사이트는 https://ius.io/이며, 소스코드는 GitHub에서 관리된다. 특히 git 설치 시 공식 문서에서도 추천하는 대안으로 언급된다: https://git-scm.com/download/linux.

IUS는 공식 저장소와 충돌을 피하기 위해 패키지 이름을 특수 규칙으로 변경한다: {원본명}{메이저버전}{마이너버전}u. 예를 들어, git의 경우 git2u로 설치된다.

기본 설치 절차

yum install epel-release
rpm -U https://centos7.iuscommunity.org/ius-release.rpm
yum remove git
yum install git2u

국내 반영서버 설정 (성능 향상)

IUS 공식 서버 접근 속도가 느릴 경우, 국내 미러를 사용하면 효과적이다. 주요 미러:

  • 알리바바 클라우드: https://mirrors.aliyun.com/ius/
  • 청화대 미러: https://mirrors.tuna.tsinghua.edu.cn/ius/
  • 동남대학 미러: https://mirrors.tongji.edu.cn/ius/

설정 파일 수정 예시:

sed -i "s|repo.ius.io|mirrors.tuna.tsinghua.edu.cn/ius|g" /etc/yum.repos.d/ius.repo

수정된 /etc/yum.repos.d/ius.repo 내용:

[ius]
name = IUS for Enterprise Linux 7 - $basearch
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/
enabled = 1
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

[ius-debuginfo]
name = IUS for Enterprise Linux 7 - $basearch - Debug
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/debug/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

[ius-source]
name = IUS for Enterprise Linux 7 - Source
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/src/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

SCL을 통한 다중 버전 소프트웨어 관리

SCL(Software Collections)은 단순한 패키지 설치 도구가 아니라, 여러 버전의 소프트웨어를 동시에 설치하고, 필요 시 특정 환경을 활성화하는 가상 환경 개념을 제공한다. 이는 시스템 기본 환경에 영향을 주지 않도록 설계되어 있다.

예: Git 2.9 버전 활성화

yum install centos-release-scl
yum install rh-git29
scl enable rh-git29 bash
git --version

지속적인 환경 적용 설정

세션 종료 후에도 자동으로 활성화되게 하려면, 사용자 또는 전체 시스템 설정 파일에 명령어를 추가한다.

  • 특정 사용자용:
  • vi ~/.bashrc
    source scl_source enable rh-git29
    
  • 전체 시스템용:
  • vi /etc/profile.d/enable_scl.sh
    #!/bin/bash
    source scl_source enable rh-git29
    

또는 직접 경로 링크를 통해 시스템 경로에 등록:

scl enable rh-git29 bash
which git
# 출력: /opt/rh/rh-git29/root/usr/bin/git
ln -s /opt/rh/rh-git29/root/usr/bin/git /usr/bin/git

참고 리소스

태그: IUS SCL CentOS software collections Git

6월 25일 00:27에 게시됨