폐쇄망 RHEL 로컬 리포지토리(Local YUM) 및 createrepo 설정

💡 핵심 요약 (Executive Summary)

본 가이드는 rhel local repository setup 핵심 가이드 및 실전 아키텍처의 핵심 개념, 실전 구성 명령어 및 아키텍처 베스트 프랙티스를 다룹니다. 클라우드 네이티브 및 인프라 엔지니어링 실무에 즉시 활용 가능하도록 체계적으로 정리했습니다.

📑 Table of Contents
Reference & Guidelines (NOTE)

환경 : rhel 9.1 qcow2 vm on openstack
사용이미지 : rhel-baseos-9.1-x86_64-dvd.iso

로컬 리포지토리 구축
bash
#scp로 이미지 복사

#repository 경로 생성 후 이미지 마운트
sudo mkdir /var/repo
sudo mount -o loop rhel-baseos-9.0-x86_64-dvd.iso /var/repo/

#repository 경로지정 파일 생성
cat << EOF > /etc/yum.repos.d/rhel9-local.repo
[Local-BaseOS]
name=Red Hat Enterprise Linux 9 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Local-AppStream]
name=Red Hat Enterprise Linux 9 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF

#sudo dnf clean all
#sudo subscription-manager clean

# enabled 1에서 0으로 변경
#vi /etc/yum/pluginconf.d/subscription-manager.conf

# repolist 확인
sudo dnf repolist
sudo yum repolist
webserver 구축

export nfs
bash
# 파일시스템 외부 접근 권한 설정
vi /etc/exports

--- # 아래 내용 추가
/data/nfs 192.168.50.0/24(rw,sync,no_root_squash,no_all_squash,no_subtree_check)
---

yum install nfs-utils rpcbind
systemctl enable nfs-server
systemctl enable rpcbind
systemctl start nfs-server
systemctl start rpcbind
systemctl status nfs-server

import nfs
bash
mkdir -p /var/repo
mount -t nfs {{ repo host }}:/var/repo /var/repo


#repository 경로지정 파일 생성
cat << EOF > /etc/yum.repos.d/rhel9-local.repo
[Local-BaseOS]
name=Red Hat Enterprise Linux 9 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Local-AppStream]
name=Red Hat Enterprise Linux 9 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///var/repo/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *