Yum Daum 저장소 설정

CentOS-Base.repo를 Daum 저장소로 변경
yum 저장소 Daum으로 변경
yum 리파지토리 Daum으로
yum서버를 daum으로 바꾸기

1 기본 저장소 확인

명령어
ll /etc/yum.repos.d/
yum repolist
[root@jmnote ~]# ll /etc/yum.repos.d/
total 16
-rw-r--r--. 1 root root 1926 Jun 26  2012 CentOS-Base.repo
-rw-r--r--. 1 root root  637 Jun 26  2012 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  626 Jun 26  2012 CentOS-Media.repo
-rw-r--r--. 1 root root 2593 Jun 26  2012 CentOS-Vault.repo
[root@jmnote ~]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: data.nicehosting.co.kr
 * extras: data.nicehosting.co.kr
 * updates: data.nicehosting.co.kr
repo id                                                  repo name                                                           status
base                                                     CentOS-6 - Base                                                     6,381
extras                                                   CentOS-6 - Extras                                                      12
updates                                                  CentOS-6 - Updates                                                    738
repolist: 7,131
→ CentOS 기본설치시 yum 저장소

2 기본 저장소 보존

/etc/yum.repos.d 폴더 전체를 /etc/yum.repos.d.CentOS.bz2 파일로 압축하여 보관하자

명령어
tar cjfv /etc/yum.repos.d.CentOS.bz2 /etc/yum.repos.d/
tar tfv /etc/yum.repos.d.CentOS.bz2
→ 압축 후에 잘 압축되었는지 확인까지
실행예시
[root@jmnote ~]# tar cjfv /etc/yum.repos.d.CentOS.bz2 /etc/yum.repos.d/
tar: Removing leading `/' from member names
/etc/yum.repos.d/
/etc/yum.repos.d/CentOS-Media.repo
/etc/yum.repos.d/CentOS-Vault.repo
/etc/yum.repos.d/CentOS-Debuginfo.repo
/etc/yum.repos.d/CentOS-Base.repo
[root@jmnote ~]# tar tfv /etc/yum.repos.d.CentOS.bz2
drwxr-xr-x root/root         0 2012-10-28 09:04 etc/yum.repos.d/
-rw-r--r-- root/root       626 2012-06-26 02:30 etc/yum.repos.d/CentOS-Media.repo
-rw-r--r-- root/root      2593 2012-06-26 02:30 etc/yum.repos.d/CentOS-Vault.repo
-rw-r--r-- root/root       637 2012-06-26 02:30 etc/yum.repos.d/CentOS-Debuginfo.repo
-rw-r--r-- root/root      1926 2012-06-26 02:30 etc/yum.repos.d/CentOS-Base.repo
→ 이상없이 잘 압축되었다.

3 기본 저장소 삭제

명령어
rm -f /etc/yum.repos.d/*
ll /etc/yum.repos.d/
실행결과
[root@jmnote ~]# rm -f /etc/yum.repos.d/*
[root@jmnote ~]# ll /etc/yum.repos.d/
total 0
→ 잘 삭제되었다.

4 Daum.repo 파일 생성

/etc/yum.repos.d/ 폴더에 Daum.repo 파일을 만든다.

명령어
echo '[Daum]' > /etc/yum.repos.d/Daum.repo
echo 'name=Daum' >> /etc/yum.repos.d/Daum.repo
echo 'baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/' >> /etc/yum.repos.d/Daum.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/Daum.repo
cat /etc/yum.repos.d/Daum.repo
실행예시
[root@jmnote ~]# echo '[Daum]' > /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# echo 'name=Daum' >> /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# echo 'baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/' >> /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# echo 'gpgcheck=0' >> /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# cat /etc/yum.repos.d/Daum.repo
[Daum]
name=Daum
baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
gpgcheck=0

5 yum repo 변경 확인

명령어
ll /etc/yum.repos.d/
yum repolist
실행예시
[root@jmnote ~]# ll /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 89 Jun  1 09:02 Daum.repo
[root@jmnote ~]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Daum                                                                                                        | 3.7 kB     00:00     
Daum/primary_db                                                                                             | 4.4 MB     00:00     
repo id                                                         repo name                                                    status
Daum                                                            Daum                                                         6,381
repolist: 6,381
→ 잘 변경되었다.

6 원상복구

Daum repo 대신 CentOS 기본 저장소를 사용하고 싶을 경우도 있을 것이다.[1] Daum.repo 파일을 삭제하고 /etc/yum.repos.d.CentOS.bz2를 이용하여 복원하자.

명령어
rm -f /etc/yum.repos.d/Daum.repo
tar xjfv /etc/yum.repos.d.CentOS.bz2 -C /
ll /etc/yum.repos.d/
yum repolist
실행예시
[root@jmnote ~]# rm -f /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# tar xjfv /etc/yum.repos.d.CentOS.bz2 -C /
etc/yum.repos.d/
etc/yum.repos.d/CentOS-Media.repo
etc/yum.repos.d/CentOS-Vault.repo
etc/yum.repos.d/CentOS-Debuginfo.repo
etc/yum.repos.d/CentOS-Base.repo
[root@jmnote ~]# ll /etc/yum.repos.d/
total 16
-rw-r--r--. 1 root root 1926 Jun 26  2012 CentOS-Base.repo
-rw-r--r--. 1 root root  637 Jun 26  2012 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  626 Jun 26  2012 CentOS-Media.repo
-rw-r--r--. 1 root root 2593 Jun 26  2012 CentOS-Vault.repo
[root@jmnote ~]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: data.nicehosting.co.kr
 * extras: data.nicehosting.co.kr
 * updates: data.nicehosting.co.kr
repo id                                                  repo name                                                           status
base                                                     CentOS-6 - Base                                                     6,381
extras                                                   CentOS-6 - Extras                                                      12
updates                                                  CentOS-6 - Updates                                                    738
repolist: 7,131
→ 최초 상태로 돌아왔다.

7 같이 보기

8 주석

  1. 아마 없을거다 …

9 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}