yum-config-manager 명령어 | YUM 저장소 설정

yum 명령어는 기본 사용 시 기본 저장소(보통 안정화 버전)에서 패키지를 설치합니다. 저장소 파일을 추가하면 안정화(stable) 또는 최신(mainline) 버전 중 활성화된 저장소에서 패키지를 설치할 수 있습니다.

안정화와 최신 버전 저장소가 모두 활성화되어 있을 경우, yum은 버전이 더 높은 패키지(보통 최신 버전)를 설치합니다.

원하는 버전을 설치하려면, remi 저장소 설정 또는 yum-config-manager를 사용하여 특정 저장소를 활성화해서 진행할 수 있습니다.

방법

설명

Remi 저장소 설정

· Remi 저장소 설치 후 설치 가능 버전 지정(주로 PHP)
· Remi 저장소에서 원하는 버전 모듈 활성화 후 설치

yum-config-manager

특정 저장소 활성화/비활성화하여 원하는 저장소 패키지 설치

✅ yum 저장소 /etc/yum.repos.d/

yum 저장소는 기본 저장소, EPEL, REMI 저장소 등으로 나뉩니다.

├── yum
│    ├──repo
│        ├── Base.repo
│        ├── epel.repo
│        ├── remi.repo
├── yum-utils
│    ├── yum-config-manager
│    ├── yum-groups-manager
│    ├── yum-builddep
│    ├── yumdownloader
│    ├── yum-debuginfo-install
│    ├── package-cleanup
│    ├── repoquery
│    └── repo-graph

🔲 .Base.repo

기본 저장소는 레드햇 계열 리눅스 배포판에 기본으로 포함된 공식 저장소로, 안정화 되고 검증된 패키지를 제공합니다. 이 저장소는 시스템의 기본 소프트웨어 설치와 업데이트에 주로 사용됩니다.

/etc/yum.repos.d/almalinux-baseos.repo
/etc/yum.repos.d/CentOS-Base.repo

CentOS-Base.repo 파일입니다.

YUM 저장소_CentOS-Base.repo(CentOS 7)

🔲 epel.repo

EPEL 저장소는 Extra Packages for Enterprise Linux의 약자로, 기본 저장소에 포함되지 않은 추가적인 오픈소스 소프트웨어 패키지를 제공합니다.

yum -y install epel-release

yum.repos.d]# ll epel*
-rw-r--r--. 1 root root 1050 10월  3  2017 epel-testing.repo
-rw-r--r--. 1 root root  951 10월  3  2017 epel.repo

🔲 remi.repo

Remi 저장소는 최신 PHP 버전과 관련 확장 패키지를 제공하는 저장소로, 프랑스 개발자 Remi Collet의 이름에서 시작되었습니다. 기본 저장소에 없는 최신 PHP 기능과 버전을 손쉽게 설치하고 관리할 수 있도록 지원합니다.

EPEL을 먼저 설치하지 않으면 Remi 저장소에서 일부 의존 패키지가 누락되어 설치 오류가 날 수 있습니다.

red Hat 계열에 따른 Remi 저장소 설치 경로

RHEL/CentOS/AlmaLinux/RockyLinux 7
https://rpms.remirepo.net/enterprise/remi-release-7.rpm

RHEL/CentOS/AlmaLinux/RockyLinux 8
https://rpms.remirepo.net/enterprise/remi-release-8.rpm

RHEL/AlmaLinux/RockyLinux 9
https://rpms.remirepo.net/enterprise/remi-release-9.rpm

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
root@localhost yum.repos.d]# ll remi*
-rw-r--r--. 1 root root  855 11월 28  2023 remi-modular.repo
-rw-r--r--. 1 root root  456 11월 28  2023 remi-php54.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php70.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php71.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php72.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php73.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php74.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php80.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php81.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php82.repo
-rw-r--r--. 1 root root 1314 11월 28  2023 remi-php83.repo
-rw-r--r--. 1 root root  750 11월 28  2023 remi-safe.repo
-rw-r--r--. 1 root root 2605 11월 28  2023 remi.repo

🔲 저장소 활용

일반 저장소 nginx 공식 저장소를 추가 후 nginx 설치를 진행합니다.

RHEL, Debian 등 주요 리눅스 배포판용 Nginx 공식 저장소입니다.
RHEL 계열에서는 RPM 패키지가 저장된 URL을 YUM 저장소에서 등록하여 설치를 진행합니다.

yum.repos.d]# vi nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://nginx.org/keys/nginx_signing.key

yum.repos.d] yum --enablerepo="nginx-stable" list available nginx
YUM 저장소_CentOS-nginx.repo(CentOS 7)_설치 가능 목록 확인
yum.repos.d] yum -y install nginx
yum.repos.d]# nginx -v
nginx version: nginx/1.26.1

Remi 저장소를 설치할때 의존성으로 EPEL 저장소가 함께 설치됩니다.

root@localhost ~]# yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

root@localhost ~]# yum install -y php83 php83-php-mbstring php83-php-cli php83-php-fpm php83-php-mysqlnd php83-php-xml
root@localhost ~]# php83 -v
PHP 8.3.8 (cli) (built: Jun  4 2024 14:53:17) (NTS gcc x86_64)
Copyright (c) The PHP Group
root@localhost ~]# Zend Engine v4.3.8, Copyright (c) Zend Technologies
which php83
/usr/bin/php83
root@localhost ~]# which php83
/usr/bin/php83
root@localhost ~]# ln -s /usr/bin/php83 /usr/bin/php
root@localhost ~]# which php
/usr/bin/php
root@localhost ~]# php -v
PHP 8.3.8 (cli) (built: Jun  4 2024 14:53:17) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies

root@localhost ~]# ll /etc/opt/remi/php83/php.ini
-rw-r--r--. 1 root root 63038  6월  5  2024 /etc/opt/remi/php83/php.ini

✅ yum-config-manager

yum-config-manager를 사용하려면 yum-utils 패키지를 먼저 설치합니다.(Remi 저장소도 설치되어 있어야 합니다.)

yum install -y yum-utils
yum-config-manager 사용을 위한 yum-utils 설치

설치된 저장소를 확인합니다.

root@localhost yum.repos.d]#  yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * remi-safe: ftp.riken.jp
repo id                           repo name                                                                     status
base/x86_64                       CentOS-7 - Base                                                               10,072
extras/x86_64                     CentOS-7 - Extras                                                                526
remi-safe                         Safe Remi's RPM repository for Enterprise Linux 7 - x86_64                     5,596
updates/x86_64                    CentOS-7 - Updates                                                             6,173
repolist: 22,367

설치 가능한 PHP 리스트를 확인합니다.


root@localhost yum.repos.d]# yum repolist all | grep php 
remi-php54                          Remi's PHP 5.4 RPM repositor disabled
remi-php55                          Remi's PHP 5.5 RPM repositor disabled
remi-php55-debuginfo/x86_64         Remi's PHP 5.5 RPM repositor disabled
remi-php56                          Remi's PHP 5.6 RPM repositor disabled
remi-php56-debuginfo/x86_64         Remi's PHP 5.6 RPM repositor disabled
remi-php70                          Remi's PHP 7.0 RPM repositor disabled
remi-php70-debuginfo/x86_64         Remi's PHP 7.0 RPM repositor disabled
remi-php70-test                     Remi's PHP 7.0 test RPM repo disabled
remi-php70-test-debuginfo/x86_64    Remi's PHP 7.0 test RPM repo disabled
remi-php71                          Remi's PHP 7.1 RPM repositor disabled
...

root@localhost yum.repos.d]# yum repolist all | grep php83
remi-php83                          Remi's PHP 8.3 RPM repositor disabled
remi-php83-debuginfo/x86_64         Remi's PHP 8.3 RPM repositor disabled
remi-php83-test                     Remi's PHP 8.3 test RPM repo disabled
remi-php83-test-debuginfo/x86_64    Remi's PHP 8.3 test RPM repo disabled

yum –enablerepo=remi-safe 명령으로 안전 모드를 활성화 한 후에 설치할 php 8.0 버전을 활성화 합니다.

yum --enablerepo=remi-safe list php*
 
yum-config-manager --enable remi-php80
yum-config-manager --enable remi-php83

yum repolist enabled | grep php
 * remi-php80: ftp.riken.jp
remi-php80     Remi's PHP 8.0 RPM repository for Enterprise Linux 7 - x86    418

 php -v
PHP 8.0.30 (cli) (built: Jun  4 2024 15:19:49) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
 
 [root@localhost ~]# which php
/usr/bin/php

php 7.2 버전을 직접 입력해서 설치 해 보겠습니다.

yum -y install php72

php72 -v
PHP 7.2.34 (cli) (built: Jun  5 2024 08:10:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

which php72
/usr/bin/php72

ll /usr/bin/php72
lrwxrwxrwx. 1 root root 32  6월 14 22:48 /usr/bin/php72 -> /opt/remi/php72/root/usr/bin/php

php 8.0 버전은 모듈 설치 방식(yum-config-manager + remi-phpXX enable)으로 진행하였으며, 기본 php 저장 경로에 설치 되었습니다. php 7.2 버전의 경우 SCL 방식(Software Collections)으로 설치가 되었으며, /opt/remi/php72 경로에 설치 되었습니다.

특징 / 방식

SCL 방식

모듈 전환 방식

설치 경로

/opt/remi/php[xx]/

/usr/bin/php

공존 가능 여부

가능

불가

기본 PHP 영향

없음

교체됨

실행 명령 예시

php83, php74 등 별도 실행

php 명령어로 바로 실행

다중 버전 운영

가능 (심볼릭 링크로 전환 가능)

불가능 (한 버전만 활성화)

Similar Posts

  • [Shell 특수문자] 리눅스 와일드카드(메타문자)

    리눅스 와일드카드는 Shell 특수문자로 메타 문자로 불리기도 합니다. Shell 특수 기호 중 와일드카드(글로빙으로 부르기도 함)는 문자 패턴에 따라 파일명을 선택할 수 있습니다. 특수 문자에는 인용(따옴표) 기호, 리눅스 다중 명령어, 리눅스 히스토리 기호, 리눅스 디렉토리 기호, 리눅스 괄호 기호 및 입출력 리다이렉션 등 다양하게 있습니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅…

  • 리눅스 tar 명령어: 파일 압축, 해제

    리눅스 tar 명령어는 여러 개의 파일을 하나의 파일로 묶거나 해제할 때 사용하는 명령어로 웹사이트의 이전 등에 mysqldump와 같이 사용되는 경우가 많습니다. 테이프 아카이버(Tape Archiver)의 앞 글자를 따서 tar라는 이름으로 부르게 되었습니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager✅ 리눅스 tar 명령어의 이해 리눅스에서 tar로 압축 진행을 할 때 압축(compress)한다고 표현하지만…

  • [Linux] 다중 명령어 5가지(세미콜론, 파이프, 엠퍼센트..)

    리눅스의 Bash Shell에서 다중 명령어를 사용하는 목적은 하나의 라인에서 여러 명령을 실행할 수 있기 때문입니다. 종류는 ⓐ 세미콜론(;) ⓑ 파이프(|) ⓒ 더블 버티컬바(||) ⓓ 엠퍼센트(&) ⓔ 더블엠퍼센트(&&) 등이 있습니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager1. 많이 쓰는 다중 명령어 세미콜론(;) 하나의 명령어 라인에서 여러 개의 명령을 실행하며, 처음 명령어…

  • 리눅스 less 명령어 사용법

    리눅스 less 명령어는 텍스트 파일을 볼 때 사용하는 명령어입니다. less 명령어의 특징은 vi 명령어가 파일 실행 시 전체 파일을 읽어야 하고 txt 파일 크기가 클 경우 읽는데 시간이 걸립니다. 또한 vi 명령어는 파일 편집 명령어입니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager리눅스 less 명령어 기본 사용 방법 less 명령 사용…

  • 리눅스 grep 명령어

    리눅스 grep 명령어는 로그 파일과 같은 텍스트 파일과 아스키 파일에서 원하는 문자열을 찾을 때 사용되며, tail과 find 명령어를 파이프(|)와 결합해서 자주 사용하게 되는 명령어입니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager✅ grep 명령어 기본 사용법 ✅ 기본적인 사용 예 ✅ grep 옵션 ✅ 다른 명령어와 파이프(|) 조합 활용 다중 명령어인…

  • 리눅스 touch 명령어

    touch 명령어는 파일의 날짜 시간 정보를 변경하는 명령어입니다. 아무 옵션 없이 사용할 경우 파일의 최근 사용 시간, 변경 시간이 서버의 현재 시간으로 변경됩니다. 파일이 없는 파일명을 입력할 경우 새로운 크기가 0인 빈 파일이 생성됩니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager✅ touch 명령어 기본 사용 방법 ✅ touch 명령어 명령어…

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Prove your humanity: 5   +   8   =