[리눅스] RHCSA 9(3), Repository 등록 (feat.gpgkey, gpgcheck)
- IT/linux
- 2024. 3. 28. 09:07
반응형
문제3. 기본 저장 공간(Repository)을 아래 지시 사항에 맞게 설정하라.
* 아래는 제가 임의로 작성한 예시입니다.실전에서는 시험장 환경에 맞는 저장소 정보가 주어집니다.
실습용 저장소 1: https://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
실습용 저장소 2: https://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os/
Repo 생성(등록)
[root@servera ~]# dnf config-manager --add-repo http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
Adding repo from: http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
[root@servera ~]# dnf config-manager --add-repo http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
Adding repo from: http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
세부 설정값 확인
[servera]# cd /etc/yum.repos.d/
[servera]# ls
mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_.repo
mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os.repo
[servera]# cat mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_.repo
[mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_]
name=created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
baseurl=http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
enabled=1
gpgcheck=0
[servera]# cat mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os.repo
[mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os]
name=created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
baseurl=http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
enabled=1
gpgcheck=0
만약 문제에서 인증키(gpgkey)를 등록하고 활성화하라고 한다면?
아래처럼 생성된 repo 파일 수정이 필요하다.
[servera]# cat mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_.repo
[mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_]
name=created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
baseurl=http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
enabled=1
gpgkey=1.1.1.1 // 임의로 설정한 값이며, 시험장에서는 다른 gpgkey값이 주어질 것이다.
gpgcheck=1 // 1=enable, 0=disable
[servera]# cat mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os.repo
[mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os]
name=created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
baseurl=http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
enabled=1
gpgkey=1.1.1.1
gpgcheck=1
그리고 dnf config-manager --add-repo로 등록 시 입력한 URL이 repo 파일 이름으로 생성된다.
아래처럼 간단하게 변경해준다.
[servera]# cd /etc/yum.repos.d
[servera]# ls
mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_.repo AppStream.repo
mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os_.repo BaseOS.repo
[servera]# mv mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_.repo AppStream.repo
[servera]# mv mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os_.repo BaseOS.repo
[servera]# ls
AppStream.repo
BaseOS.repo
마지막으로 기존 저장소 삭제 및 최신 저장소 목록 정상 반영되었는지 확인
[servera]# dnf clean all // 기존 저장소 정보 삭제
25 files removed
[servera]# dnf repolist // 현재 저장소 목록 확인
repo id repo name
appstream Rocky Linux 9 - AppStream
baseos Rocky Linux 9 - BaseOS
extras Rocky Linux 9 - Extras
mirror.navercorp.com_rocky_9.3_AppStream_x86_64_os_ created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/AppStream/x86_64/os/
mirror.navercorp.com_rocky_9.3_BaseOS_x86_64_os created by dnf config-manager from http://mirror.navercorp.com/rocky/9.3/BaseOS/x86_64/os
[servera]# dnf list // 현재 저장소 목록 및 설치된 패키지, 설치 가능한 패키지 목록
created by dnf config-manager from http://mirro 43 MB/s | 7.4 MB 00:00
created by dnf config-manager from http://mirro 28 MB/s | 2.2 MB 00:00
Rocky Linux 9 - BaseOS 3.5 MB/s | 2.2 MB 00:00
Rocky Linux 9 - AppStream 9.3 MB/s | 7.4 MB 00:00
Rocky Linux 9 - Extras 24 kB/s | 14 kB 00:00
Installed Packages
NetworkManager.x86_64 1:1.44.0-3.el9 @minimal
NetworkManager-libnm.x86_64 1:1.44.0-3.el9 @minimal
NetworkManager-team.x86_64 1:1.44.0-3.el9 @minimal
NetworkManager-tui.x86_64 1:1.44.0-3.el9 @minimal
PackageKit.x86_64 1.2.4-2.el9 @minimal
. . . (생략)
반응형
'IT > linux' 카테고리의 다른 글
[리눅스] RHCSA 9(5), SELinux 트러블 슈팅 (feat. semanage, sealert, curl, ncat) (1) | 2024.04.04 |
---|---|
[리눅스] RHCSA 9(4), 계정/그룹 생성 및 패스워드 설정(feat. nologin, --stdin) (0) | 2024.04.01 |
[리눅스] RHCSA 9(2), network 및 hostname 설정 (0) | 2024.03.27 |
[리눅스] RHCSA 9(1), root 암호 복구/분실 (0) | 2024.03.26 |
[리눅스] logrotate 개념 및 설정 방법, 로그 관리 손쉽게! (0) | 2024.03.20 |