본문 바로가기

Linux

yum 소프트웨어 리포지토리 활성화

Red Hat 소프트웨어 리포지토리 활성화
  • yum repolist all
    사용가능한 Repogitory list up
    [root@ip-172-31-27-55 ~]# yum repolist all
    Loaded plugins: priorities, update-motd, upgrade-helper
    repo id                                               repo name                                                                                 status
    !amzn-main/latest                                     amzn-main-Base                                                                            enabled: 5,302
    amzn-main-debuginfo/latest                            amzn-main-debuginfo                                                                       disabled
    amzn-nosrc/latest                                     amzn-nosrc-Base                                                                           disabled
    amzn-preview/latest                                   amzn-preview-Base                                                                         disabled
    amzn-preview-debuginfo/latest                         amzn-preview-debuginfo                                                                    disabled
    !amzn-updates/latest                                  amzn-updates-Base                                                                         enabled: 1,298
    amzn-updates-debuginfo/latest                         amzn-updates-debuginfo                                                                    disabled
    !epel/x86_64                                          Extra Packages for Enterprise Linux 6 - x86_64                                            disabled
    epel-debuginfo/x86_64                                 Extra Packages for Enterprise Linux 6 - x86_64 - Debug                                    disabled
    epel-source/x86_64                                    Extra Packages for Enterprise Linux 6 - x86_64 - Source                                   disabled
    epel-testing/x86_64                                   Extra Packages for Enterprise Linux 6 - Testing - x86_64                                  disabled
    epel-testing-debuginfo/x86_64                         Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Debug                          disabled
    epel-testing-source/x86_64                            Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Source                         disabled
    repolist: 6,600

  • yum-config-manager
    Repogitory 활성화 및 비활성화
    그러면 /etc/yum.repos.d/redhat.repo 파일의 enabled 매개 변수가 변경
    [root@ip-172-31-27-55 ~]# yum-config-manager --enable amzn-main-debuginfo
    Loaded plugins: priorities, update-motd, upgrade-helper
    ================================================================= repo: amzn-main-debuginfo ==================================================================
    [amzn-main-debuginfo]
    async = True
    bandwidth = 0
    base_persistdir = /var/lib/yum/repos/x86_64/latest
    baseurl =
    cache = 0
    cachedir = /var/cache/yum/x86_64/latest/amzn-main-debuginfo
    check_config_file_age = True
    cost = 1000
    deltarpm_metadata_percentage = 100
    deltarpm_percentage =
    enabled = 1

타사 소프트웨어 리포지토리 활성화
웹 사이트, FTP 서버 또는 로컬 파일 시스템에서 yum을 사용하여 액세스할 수 있음.
새로운 타사 리포지토리에 대한 지원을 활성화하려면 /etc/yum.repos.d/ 디렉토리에 파일을 넣음.
리포지토리 설정 파일은 .repo 로 끝냐야 함. 리포지토리 정의에는 리포지토리의 URL, 이름, GPG를 사용하여 패키지 서명을 확인할 지 여부, 신뢰할 수 있는 GPG 키를 가리키는 URL이 포함됨.

  • yum-config-manager 사용
    yum 리포지토리의 URL을 알고 있으면 yum-config-manager를 사용하여 구성 파일을 만들 수 있음.
    [root@ip-172-31-27-55 ~]# yum-config-manager --add-repo="http://dl.fedoraproject.org/pub/epel/7/x86_64"
    Loaded plugins: priorities, update-motd, upgrade-helper
    adding repo from: http://dl.fedoraproject.org/pub/epel/7/x86_64

    [dl.fedoraproject.org_pub_epel_7_x86_64]
    name=added from: http://dl.fedoraproject.org/pub/epel/7/x86_64
    baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64
    enabled=1

    [root@ip-172-31-27-55 ~]# ls -al /etc/yum.repos.d/dl.fedoraproject.org_pub_epel_7_x86_64.repo
    -rw-r--r-- 1 root root 170 Aug 11 02:36 /etc/yum.repos.d/dl.fedoraproject.org_pub_epel_7_x86_64.repo

    [root@ip-172-31-27-55 ~]# cat /etc/yum.repos.d/dl.fedoraproject.org_pub_epel_7_x86_64.repo

    [dl.fedoraproject.org_pub_epel_7_x86_64]
    name=added from: http://dl.fedoraproject.org/pub/epel/7/x86_64
    baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64
    enabled=1

  • dl.fedoraproject.org_pub_epel_7_x86_64.repo 파일 수정
    사용자 지정 이름 및 GPG 키의 위치를 제공.
    관리자는 yum으로 외부 소스에서 키를 검색하기보다 로컬 파일로 키를 다운로드해야 함.
    [dl.fedoraproject.org_pub_epel_7_x86_64]
    name=added from: http://dl.fedoraproject.org/pub/epel/7/x86_64
    baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

리포지토리용 RPM  구성 패키지
일부 리포지토리는 이 구성 파일과 GPG 공개 키를 yum localinstall을 사용하여 다운로드 및 설치할 수 있는 RPM 패키지의 일부로 제공.
한 가지 예는 Red Hat이 지원하지 않지만 Red Hat Enterprise Linux와 호환되는 소프트웨어를 제공하는 자원 프로젝트 EPEL(Extra Packages for Enterprise Linux).

  • Red Hat Enterprise Linux 7 EPEL 리포지토리 패키지 설치
    [root@ip-172-31-27-55 ~]# rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

    [root@ip-172-31-27-55 ~]# yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    Loaded plugins: priorities, update-motd, upgrade-helper
    epel-release-7-5.noarch.rpm                                                                                                            |  14 kB     00:00    
    Examining /var/tmp/yum-root-LptB3X/epel-release-7-5.noarch.rpm: epel-release-7-5.noarch
    Marking /var/tmp/yum-root-LptB3X/epel-release-7-5.noarch.rpm as an update to epel-release-6-8.9.amzn1.noarch
    Resolving Dependencies
    amzn-main/latest                                                                                                                       | 2.1 kB     00:00    
    amzn-main-debuginfo/latest                                                                                                             | 1.9 kB     00:00    
    amzn-updates/latest                                                                                                                    | 2.3 kB     00:00    
    dl.fedoraproject.org_pub_epel_7_x86_64                                                                                                 | 4.4 kB     00:00    
    --> Running transaction check
    ---> Package epel-release.noarch 0:6-8.9.amzn1 will be updated
    ---> Package epel-release.noarch 0:7-5 will be an update
    --> Finished Dependency Resolution

    Dependencies Resolved

    ===============================================================================================
    Package                               Arch                            Version                        Repository                                         Size
    ===============================================================================================
    Updating:
    epel-release                          noarch                          7-5                            /epel-release-7-5.noarch                           24 k

    Transaction Summary
    ===============================================================================================
    Upgrade  1 Package

    Total size: 24 k
    Is this ok [y/d/N]: 
경고
서명된 패키지를 설치하기 전에 RPM GPG 키를 설치. 이것은 패키지가 가져온 키에 속하는지 확인. 그렇지 않으면 yum에서 누락된 키에 대해 보고
(--nogpgcheck 옵션을 사용하면 누락된 GPG 키를 무시할 수 있지만, 위조되거나 안전하지 않은 패키지가 시스템에 설치되어 보안성을 잠재적으로 훼손할 수 있음)

References
  • https://access.redhat.com/documentation/ 에서 찾을 수 있는 Red Hat Enterprise Linux 7용 Red Hat Enterprise Linux 시스템 관리자 가이드에 포함된 yum 및 yum 리포지토리 구성에 대한 섹션에서 추가 정보를 찾을 수 있음
  • yum(1), yum.conf(5) 및 yum-config-manager(1) man pages