리눅스

yum repository 설정

정지홍 2024. 8. 5. 17:55

local Repository란?

  • 일반적으로 서버는 외부 통신이 되지 않는 폐쇠망에서 운영되니 로컬로 구성해야함
  • RPM기반의 리눅스 패키지들이 존재하는 저장소

local Yum Repository란?

  • 로컬 내에서만 돌아가는 YUM저장소
  • ‘레포 잡아주세요’ == local Repo를 잡아주는것

YUM이란?

  • Yellowdog Updater Modified
  • 레드햇 계열에서 사용되는 명령어로, RPM 패키지를 관리하는 도구
  • 패키지 관련 설치, 제거, 저장소 업데이트, 원상복구 등 작업에 사용
  • RHEL 8 이상은 dnf로 대신함
  • 이때 /etc/yum.repos.d/~ 에 설정되어 있는 Repository에서 패키지를 가져와 설치함.

yum repository란?

  • 리눅스의 패키지 관리 도구

yum repository 리스트 확인

  • yum repolist

yum repository의 설정 위치

  • /etc/yum.repos.d에 위치해있음
  • 위의 yum repolist명령어 실행시 리스트의 내용이 여기에 존재

 

[root@localcentos /]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: ftp.jaist.ac.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * epel: ftp.kddilabs.jp
repo id                        repo name                                             status
base                           CentOS                                                10,072
centos-sclo-rh/x86_64          CentOS-7 - SCLo rh                                     8,170
centos-sclo-sclo/x86_64        CentOS-7 - SCLo sclo                                     816
epel/x86_64                    Extra Packages for Enterprise Linux 7 - x86_64        13,791
openjdk                        OpenJDK                                                    2
repolist: 32,851

[root@localcentos /]# cd /etc/yum.repos.d
[root@localcentos yum.repos.d]# ls
Centos.repo  epel-testing.repo  epel.repo  openjdk.repo  sclo.repo

[root@localcentos yum.repos.d]# yum install openjdk
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: ftp.jaist.ac.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * epel: mirror.ontdb.com
No package openjdk available.
Error: Nothing to do

yum repository 설정

yum repository를 위해서 우선 repo를 만들어 줍니다

vi /etc/yum.repos.d/jihong.repo

우선 기본으로 설정되어있는 repository 설명

[root@localcentos yum.repos.d]# cat openjdk.repo
[openjdk]
name=OpenJDK
baseurl=http://www.data-dynamics.io/dd/OpenJDK/repo/
enabled=1
gpgcheck=0
  • name=저장소 표시 이름
  • baseurl=저장소 주소
  • enabled=활성화 여부 (0 or 1)
  • gpgcheck=gpg 서명키 사용 여부 (0 or 1)
  • gpgkey=서명키 사용 시 서명키 주소

[root@localcentos ~]# yum info kernel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: ftp.jaist.ac.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * epel: mirror.ontdb.com
Installed Packages
Name        : kernel
Arch        : x86_64
Version     : 3.10.0
Release     : 1160.el7
Size        : 64 M
Repo        : installed
From repo   : anaconda
Summary     : The Linux kernel
URL         : http://www.kernel.org/
License     : GPLv2
Description : The kernel package contains the Linux kernel (vmlinuz), the core of any
            : Linux operating system.  The kernel handles the basic functions
            : of the operating system: memory allocation, process allocation, device
            : input and output, etc.
[root@localcentos ~]# yum repolist all
'Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: ftp.jaist.ac.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * epel: mirror.ontdb.com
repo id                       repo name                                     status
base                          CentOS                                        enabled: 10,072
centos-sclo-rh/x86_64         CentOS-7 - SCLo rh                            enabled:  8,170
centos-sclo-sclo/x86_64       CentOS-7 - SCLo sclo                          enabled:    816
epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_6 enabled: 13,791
epel-debuginfo/x86_64         Extra Packages for Enterprise Linux 7 - x86_6 disabled
epel-source/x86_64            Extra Packages for Enterprise Linux 7 - x86_6 disabled
epel-testing/x86_64           Extra Packages for Enterprise Linux 7 - Testi disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testi disabled
epel-testing-source/x86_64    Extra Packages for Enterprise Linux 7 - Testi disabled
openjdk                       OpenJDK                                       enabled:      2
repolist: 32,851
# 모든 레포지토리를 표시
# 활성만 보고 싶다면 all대신에 enable옵션을......
# 비활성만 보고 싶다면 disabled...



=============================================================================

https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux/7/html/system_administrators_guide/sec-configuring_yum_and_yum_repositories

 

9.5. YUM 및 YUM 리포지토리 구성 | Red Hat Product Documentation

예 9.28. /etc/yum.conf의 사용자 지정 섹션에 정의된 리포지토리 활성화. [example], [example-debuginfo], [example-source]섹션에 정의된 리포지토리를 활성화하려면 다음을 입력합니다. ~]# yum-config-manager --enable

docs.redhat.com

 


 

'리눅스' 카테고리의 다른 글

shell script  (0) 2024.08.07
/etc/sysctl.conf , /etc/sysctl.d , sysctl -a와 -p ,  (0) 2024.08.07
hostnamectl set-hostname <HOSTNAME>  (0) 2024.08.03
/etc/security/limits.conf , /etc/security/limits.d/*  (0) 2024.08.03
ssh  (1) 2024.08.03