#  RHEL 설치용 ISO 이미지 파일을 준비

   # usb 마운트 하기 
   # lsblk -f  또는 # fdisk -l  로 파일시스템 및 usb 장착 상태 확인 
   # mount -t vfat /dev/sdb1 /mnt/backup   // dev/sdb1에 있는 usb데이터를 /mnt/backup 디렉토리에 마운트 
   # lsblk -f  또는 # fdisk -l   // 로 확인 
   # /mnt/backup로 이동하여 usb데이터 있는지 확인 
    
 # local repository 만들기 
  1. repo data 원하는 곳으로 copy ( /repo 등으로 이동 - 아래참고)
   # cp -r /mnt/backup/BaseOS/* /repo/BaseOS
   # cp -r /mnt/backup/AppStream/* /repo/AppStream
  2. /etc/yum.repos.d/ 디렉토리에 새로운 .repo 파일을 생성 
   # vi /etc/yum.repos.d/rhel9local.repo
    [BaseOS-local]
    name=RHEL 9 BaseOS Local Repository
    baseurl=file:///repo/BaseOS
    enabled=1
    gpgcheck=0
    [AppStream-local]
    name=RHEL 9 AppStream Local Repository
    baseurl=file:///repo/AppStream
    enabled=1
    gpgcheck=0 
   3. dnf clean all   // 수행 
   4. dnf repolist   // 수행
   5. dnf install nano    // 설치 되는지 TEST 
   - 잘 된다면 설치 완료    
   
 # local repository  삭제 할 경우 
  1. 임시로 비활성화:
    BaseOS-local: sudo yum-config-manager --disable BaseOS-local
    AppStream-local: sudo yum-config-manager --disable AppStream-local
    또는 해당 repo 파일에서 enabled=0로 변경:
    sudo vi /etc/yum.repos.d/rhel9local.repo
각 섹션에 enabled=0로 수정 후 저장
  2. 로컬 리포지터리 제거
   # sudo rm -f /etc/yum.repos.d/rhel9local.repo

 

 

 

 

# dnf reposync 명령어는 원격의 DNF/YUM 저장소에 있는 패키지들을 로컬 디렉토리에 복사하여 저장하는 데 사용됩니다. 기본적으로 이미 로컬에 존재하는 패키지는 다시 다운로드하지 않으며, 저장소 전체 또는 특정 저장소(repoid로 지정)에서 패키지들을 동기화할 수 있습니다.

 

1. 명령어 설명

# dnf reposync --download-path=/repo/baseos --repoid=rhel-9-for-x86_64-baseos-rpms --download-metadat

 

--download-path=/repo/baseos
다운로드된 패키지들이 저장될 로컬 경로를 지정합니다. 여기서는 /repo/baseos 디렉토리에 저장합니다.

--repoid=rhel-9-for-x86_64-baseos-rpms
동기화할 저장소의 ID를 지정합니다. 이 옵션으로 특정 저장소만 선택하여 다운로드합니다.

--download-metadata
저장소의 메타데이터(repo 데이터)를 함께 다운로드합니다. 이 메타데이터를 포함하면 로컬에 있는 패키지 저장소를 바로 다시 DNF가 인식하여 사용할 수 있습니다.

 

즉 이 명령어는 RHEL 9의 rhel-9-for-x86_64-baseos-rpms 저장소에서 패키지와 메타데이터를 /repo/baseos 경로 아래로 받아 로컬 오프라인 저장소를 구성하는 기능을 합니다

 

2.   RHEL repository 추가 활성화 하기 ( highavailability-rpms) 
 # subscription-manager repos --enable=rhel-9-for-x86_64-highavailability-rpms
 # subscription-manager repos --enable=rhel-9-for-x86_64-resilientstorage-rpms

 

3. 동기화할 목록 정보 확인하기 

# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-resilientstorage-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - Resilient Storage (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/resilientstorage/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/appstream/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-highavailability-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/highavailability/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/baseos/os
Enabled:   1

 

 

 

 

+ Recent posts