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

  • 리눅스 host 명령어 | DNS 조회 명령어

    host 명령어는 DNS(Domain Name System) 조회를 할 때 사용하는 명령어입니다. 호스트 이름에 해당하는 IP 주소를 찾거나, 반대로 IP 주소를 호스트 이름으로 변환하는 데 사용됩니다. 네트워크 연결 문제를 해결하거나 호스트 이름과 IP 주소 간의 매핑을 확인하는 데 유용합니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager✅ host 명령어 사용법 기본 사용 옵션은…

  • 리눅스 free 명령어: 메모리 상태 확인

    리눅스 free 명령어는 서버의 메모리 사용량과 여유 사용량을 확인할 수 있는 명령어로 /proc/meminfo의 메모리 정보를 가져와 보여줍니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager✅ 리눅스 free 명령어 옵션 1. free -h 설명 2. 옵션 활용 ✅ 스왑(SWAP)메모리란? ✅ 명목 메모리 사용량 계산법 free(1239384)는 실제로 사용되지 않은 메모리 용량이며 100% 사용…

  • 리눅스 리다이렉션(Redirection)

    웹 상에서 리다이렉션(Redirection)은 웹 브라우저가 특정 URL을 요청했을 때, 미리 지정된 다른 URL로 재요청하게 하는 것을 말합니다. 재 연결의 사전적인 의미를 가진 Redirection은 리눅스에서 입력과 출력을 다루는 방식으로, 데이터를 파일로 보내거나 파일에서 읽어오는 작업을 수행할 수 있게 해줍니다. 리눅스 리다이렉션은은 키보드로 입력, 화면으로 출력을 하는 것이 아니라 파일로 출력하는 것을 의미합니다. 리다이렉션에는 표준…

  • 리눅스 touch 명령어

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

  • 리눅스: useradd 명령어 & passwd 명령어

    useradd 명령어는 리눅스에서 사용자의 ID(계정)를 생성하는 명령어입니다. root 권한으로 생성이 가능하며 기본적인 명령은 아래와 같습니다. 목차✅ yum 저장소 /etc/yum.repos.d/🔲 .Base.repo🔲 epel.repo🔲 remi.repo🔲 저장소 활용✅ yum-config-manager리눅스 useradd 명령어 옵션 리눅스 useradd 사용 예 기본으로 사용할 수 있는 예입니다. 리눅스 /etc/skel 디렉토리 계정 생성 시 설정 값이 정의되는 /etc/skel 데릭토리는 사용자를 생성 했을 때 해당…

  • 리눅스 head 명령어 & tail 명령어

    리눅스 head 명령어는 파일의 처음 10줄을 보여주는 명령어이며, tail 명령어는 파일의 마지막 10줄을 보여주는 명령어입니다. 옵션 없이 사용할 경우 각각의 머리와 꼬리 부분을 보여주는 것을 알 수 있습니다. head와 tail 명령어는 보통 서버의 access_log를 볼 때 주로 많이 사용됩니다. 두 명령어의 사용법과 테스트 서버에서 access_log를 각각의 명령어를 통해 확인 해 보겠습니다. 목차✅ yum…

답글 남기기

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

Prove your humanity: 0   +   3   =