Profile

생각정리..

Lunight

[CentOS] 미러사이트를 변경하자



Docker를 쓰는경우 오래된 OS 또는 불필요한 패키지가 설치되지 않기때문에 


CentOS 또는 Ubuntu에서 미러사이트를 이용하여 패키지를 받아야한다 


하지만 오래걸리거나.... 접속이 되지않는 오래된 미러사이트들...ㅠㅠ


그래서 미러사이트를 변경해서 빠르게 패키지를 다운받아 보자!





0. 국내 미러사이트 List


다음카카오 http://ftp.daumkakao.com/centos


카이스트 http://ftp.kaist.ac.kr/CentOS


네이버 http://mirror.navercorp.com/centos


CentOS 미러리스트 사이트는 다음과 같다 

https://www.centos.org/download/mirrors/





1. 기존 저장소 압축 백업


yum mirror list 위치 



# yum repolist    // yum 저장소 확인

# yum repolist all    // disabled 된 저장소까지 모두 보여준다. 



# yum install bzip2   // 압축패키지 설치 


# bzip2 /etc/yum.repos.d/CentOS-*.repo    // 기존 저장소내역 압축




2. daum.repo 생성하기 


[root@localhost /]# echo '[base]

> name=CentOS-$releasever - Base

> baseurl=http://ftp.daumkakao.com/centos/$releasever/os/$basearch/

> gpgcheck=0

> [updates]

> name=CentOS-$releasever - Updates

> baseurl=http://ftp.daumkakao.com/centos/$releasever/updates/$basearch/

> gpgcheck=0

> [extras]

> name=CentOS-$releasever - Extras

> baseurl=http://ftp.daumkakao.com/centos/$releasever/extras/$basearch/

> gpgcheck=0' > /etc/yum.repos.d/Daum.repo




3. 복구하기 


# rm -rf /etc/yum.repos.d/Daum.repo


#bunzip2 /etc/yum.repos.d/CentOS-*


#yum repolist