Linux

Rocky Linux Repository를 카이스트 Repository로 변경

졸린하루 2023. 12. 13. 17:20

Rocky Linux Repository의 주소를 카이스트로 변경해보겠습니다.

한국에서는 현재 2개의 도메인에서 mirror 서비스를 진행한다. 이 중 카이스트로 변경하는 법입니다.

- yum.repos.d로 이동한다 후 repository 설정을 확인한다.
[root@rocky ~]# cd /etc/yum.repos.d/

[root@rocky yum.repos.d]# ls
Rocky-AppStream.repo  Rocky-Debuginfo.repo  Rocky-Extras.repo            Rocky-Media.repo  Rocky-Plus.repo        Rocky-RT.repo                Rocky-Sources.r
Rocky-BaseOS.repo     Rocky-Devel.repo      Rocky-HighAvailability.repo  Rocky-NFV.repo    Rocky-PowerTools.repo  Rocky-ResilientStorage.repo

[root@rocky yum.repos.d]# cat Rocky-AppStream.repo
# Rocky-AppStream.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[appstream]
name=Rocky Linux $releasever - AppStream
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[root@rocky yum.repos.d]# cat Rocky-BaseOS.repo
# Rocky-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=Rocky Linux $releasever - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

- vim을 이용하여 baseurl 주소를 카이스트로 변경해주면 된다.
[root@rocky ~]# vi /etc/yum.repos.d/Rocky-AppStream.repo
[root@rocky ~]# vi /etc/yum.repos.d/Rocky-BaseOS.repo

- 설정 변경 후 확인한다. mirrorlist는 주석처리 한다. baseurl은 카이스트로 변경 된 것을 확인할 수 있다. yum clean all를 실행한다
[root@rocky ~]# cat /etc/yum.repos.d/Rocky-AppStream.repo
# Rocky-AppStream.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[appstream]
name=Rocky Linux $releasever - AppStream
#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever
baseurl=https://ftp.kaist.ac.kr/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial


[root@rocky ~]# cat /etc/yum.repos.d/Rocky-BaseOS.repo
# Rocky-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=Rocky Linux $releasever - BaseOS
#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
baseurl=https://ftp.kaist.ac.kr/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[root@rocky8 ~]# yum clean all
23 파일이 삭제되었습니다

-  yum repolist를 이용하여 현재 Repository의 경로를 확인한다.
[root@rocky8 ~]# yum repolist appstream -v
[root@rocky8 ~]# yum repolist baseos -v

- repository 설치 test 진행
[root@rocky8 ~]# yum install network-scripts

 

이상 Repository를 kaist로 변경하는 방법이었습니다.

 

- 추가 내용

아래와 같이 error가 발생 시 해결 방법 입니다.

Rocky Linux 8 - AppStream                                                                                          0.0  B/s |   0  B     00:00
Errors during downloading metadata for repository 'appstream':
  - Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://ftp.kaist.ac.kr/pub/rocky/8/AppStream/x86_64/os/repodata/repomd.xml [SSL certificate problem: certificate has expired]
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

 

/etc/yum.conf 에 sslverify=false를 추가해주면 해결 된다.

[root@rocky ~]# vi /etc/yum.conf

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
sslverify=false

 

감사합니다.