"Yum Daum 저장소 설정"의 두 판 사이의 차이

46번째 줄: 46번째 줄:
;명령어
;명령어
<source lang='bash'>
<source lang='bash'>
echo '[Daum]' > /etc/yum.repos.d/Daum.repo
echo '[base]
echo 'name=Daum' >> /etc/yum.repos.d/Daum.repo
name=CentOS-$releasever - Base
echo 'baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/' >> /etc/yum.repos.d/Daum.repo
baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
echo 'gpgcheck=0' >> /etc/yum.repos.d/Daum.repo
gpgcheck=0
cat /etc/yum.repos.d/Daum.repo
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/
gpgcheck=0' > /etc/yum.repos.d/Daum.repo
yum repolist
</source>
</source>


;실행예시
;실행예시
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# echo '[Daum]' > /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# echo '[base]
[root@jmnote ~]# echo 'name=Daum' >> /etc/yum.repos.d/Daum.repo
> name=CentOS-$releasever - Base
[root@jmnote ~]# echo 'baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/' >> /etc/yum.repos.d/Daum.repo
> baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
[root@jmnote ~]# echo 'gpgcheck=0' >> /etc/yum.repos.d/Daum.repo
> gpgcheck=0
[root@jmnote ~]# cat /etc/yum.repos.d/Daum.repo
> [updates]
[Daum]
> name=CentOS-$releasever - Updates
name=Daum
> baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/
baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
> gpgcheck=0' > /etc/yum.repos.d/Daum.repo
gpgcheck=0
[root@jmnote ~]# yum repolist
... (생략)
repo id                                  repo name                                            status
base                                    CentOS-6 - Base                                      6,381
updates                                  CentOS-6 - Updates                                  1,555
repolist: 7,936
</source>
</source>



2013년 11월 25일 (월) 16:20 판

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

1 기존 저장소 압축 보존(선택적)

[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
... (생략)
repo id                                                  repo name                                                           status
base                                                     CentOS-6 - Base                                                     6,381
extras                                                   CentOS-6 - Extras                                                      12
updates                                                  CentOS-6 - Updates                                                    738
repolist: 7,131
[root@jmnote ~]# bzip2 /etc/yum.repos.d/CentOS-*.repo
[root@jmnote ~]# ll /etc/yum.repos.d/
total 16
-rw-r--r--. 1 root root 682 Jun 26  2012 CentOS-Base.repo.bz2
-rw-r--r--. 1 root root 442 Jun 26  2012 CentOS-Debuginfo.repo.bz2
-rw-r--r--. 1 root root 414 Jun 26  2012 CentOS-Media.repo.bz2
-rw-r--r--. 1 root root 409 Jun 26  2012 CentOS-Vault.repo.bz2
[root@jmnote ~]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
repolist: 0
→ 확장자가 repo인 파일이 없어서 repolist도 0이 되었다.

2 Daum.repo 파일 생성

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

명령어
echo '[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
gpgcheck=0 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/
gpgcheck=0' > /etc/yum.repos.d/Daum.repo
yum repolist
실행예시
[root@jmnote ~]# echo '[base]
> name=CentOS-$releasever - Base
> baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
> gpgcheck=0 
> [updates]
> name=CentOS-$releasever - Updates
> baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/
> gpgcheck=0' > /etc/yum.repos.d/Daum.repo
[root@jmnote ~]# yum repolist
... (생략)
repo id                                  repo name                                            status
base                                     CentOS-6 - Base                                      6,381
updates                                  CentOS-6 - Updates                                   1,555
repolist: 7,936

3 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
→ 잘 변경되었다.

4 (원상복구)

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
→ 최초 상태로 돌아왔다.

5 같이 보기

6 주석

  1. 아마 없을거다 …

7 참고 자료

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