기본적으로 yum 명령어는 인터넷이 되는 환경에서 작동을 하기때문에 인터넷이 되는지 부터 확인해줍니다.
1. 인터넷 연결 확인
ping google.com
2. 인터넷이 된다면 기본 저장소(yum repository) 변경을 해줍니다.
mirrolist 가 제대로 적혀있는지 확인이 필요합니다.
저는 http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra 로 사용해주었습니다.
만약 국내 미러 저장소를 쓰고싶으시다면, mirrorlist 절을 주석처리해주시고 사용하고싶은 미러저장소 적어주시면 됩니다.
카카오 미러저장소 : https://mirror.kakao.com/
Home - mirror.kakao.com
mirror.kakao.com
vi /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.kakao.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.kakao.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.kakao.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.kakao.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
3. yum 초기화
yum clean all
감사합니다.
'OS > Linux' 카테고리의 다른 글
[Linux] history 명령어 날짜:시간 표시하기 (0) | 2024.03.13 |
---|---|
[Linux] 패키지 업데이트(yum / rpm) (0) | 2024.03.12 |
Packages for Linux and Unix (0) | 2024.03.12 |
[Rocky] Terminal 원격접근 (0) | 2024.02.21 |
[Liunx] tail 명령어 사용법 (0) | 2024.02.21 |