AWS EC2에 remote yum repository 설정하기

AWS EC2에 remote yum repository 설정하기

CentOS 리눅스 시스템에서 사용되는 YUM 리포지토리 설정 파일의 예

리포지토리 설정 파일 생성

먼저, 제공된 설정을 리포지토리 설정 파일에 저장해야 합니다. 이 파일은 일반적으로 /etc/yum.repos.d/ 디렉토리에 위치합니다. 예를 들어, 파일 이름을 nexus.repo로 할 수 있습니다.

1
sudo vi /etc/yum.repos.d/nexus.repo
1
2
3
4
5
6
7
[nexusrepo]
name=Nexus Repository
baseurl=https://{id}:{pw}{remote-repo-url}/repository/yum-dspace-group/7/x86_64
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2
priority=1

YUM 캐시 클리어

YUM 캐시를 클리어하여 최신 리포지토리 정보를 불러옵니다.

1
sudo yum clean all

리포지토리 리스트 확인

리포지토리가 제대로 추가되었는지 확인합니다.

1
sudo yum repolist enabled

이 명령은 활성화된 모든 리포지토리의 리스트를 보여줍니다. nexusrepo가 리스트에 나타나야 합니다.

패키지 검색 테스트

nexusrepo 리포지토리에서 특정 패키지를 검색해보아 테스트 할 수 있습니다.

1
sudo yum --disablerepo="*" --enablerepo="nexusrepo" list available

패키지 설치 테스트

리포지토리에서 패키지를 설치하여 테스트할 수 있습니다. 예를 들어 example-package를 설치하려면 다음 명령을 사용합니다.

1
sudo yum --disablerepo="*" --enablerepo="nexusrepo" install example-package

이렇게 함으로써, 리포지토리 설정이 올바르게 작동하는지 확인할 수 있습니다. 패키지 이름은 해당 리포지토리에서 제공하는 실제 패키지 이름으로 교체해야 합니다.

AWS EC2에 remote yum repository 설정하기

https://hamin7.github.io/2024/06/25/AWS-Change-Yum-Repo/

Author

hamin

Posted on

2024-06-25

Updated on

2024-06-25

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.