YUM 저장소 만들기 실습

사전 작업

긴 실습 (rpm 만들기 포함)
짧은 실습 (rpm 만들기 미포함)[1]

저장소 생성

  • DOCUMENT_ROOT 아래에 /repo/Packages 폴더를 만든다.
[root@zetawiki ~]# mkdir -p /var/www/html/repo/Packages
[root@zetawiki ~]# cp hello-1.0.0-1.el6.x86_64.rpm /var/www/html/repo/Packages/
[root@zetawiki ~]# createrepo -v /var/www/html/repo/
Spawning worker 0 with 1 pkgs
Worker 0: reading Packages/hello-1.0.0-1.el6.x86_64.rpm
Workers Finished
Gathering worker results
 
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Starting other db creation: Sun Jun  8 14:39:05 2014
Ending other db creation: Sun Jun  8 14:39:05 2014
Starting filelists db creation: Sun Jun  8 14:39:05 2014
Ending filelists db creation: Sun Jun  8 14:39:05 2014
Starting primary db creation: Sun Jun  8 14:39:05 2014
Ending primary db creation: Sun Jun  8 14:39:05 2014
Sqlite DBs complete
[root@zetawiki ~]# cp /home/builduser/RPM-GPG-KEY-builduser /var/www/html/repo/
[root@zetawiki ~]# curl http://127.0.0.1/repo/RPM-GPG-KEY-builduser
-----BEGIN PGP PUBLIC KEY BLOCK-----
... (생략)
-----END PGP PUBLIC KEY BLOCK-----

다른 컴퓨터에서 테스트

접속 확인

[root@CentOS63 ~]# nc -z 135.79.246.80 80
Connection to 135.79.246.80 80 port [tcp/http] succeeded!
[root@CentOS63 ~]# curl http://135.79.246.80/repo/RPM-GPG-KEY-builduser
-----BEGIN PGP PUBLIC KEY BLOCK-----
... (생략)
-----END PGP PUBLIC KEY BLOCK-----

repo 등록

echo '[my-first-repo]
name=My First Repo
baseurl=http://서버주소/repo
gpgkey=http://서버주소/repo/RPM-GPG-KEY-builduser
enabled=1
gpgcheck=1' > /etc/yum.repos.d/my-first-repo.repo
yum repolist
[root@CentOS63 ~]# echo '[my-first-repo]
> name=My First Repo
> baseurl=http://135.79.246.80/repo
> gpgkey=http://135.79.246.80/repo/RPM-GPG-KEY-builduser
> enabled=1
> gpgcheck=1' > /etc/yum.repos.d/my-first-repo.repo
[root@CentOS63 ~]# yum repolist
... (생략)
repo id        repo name                                        status
base           CentOS-6 - Base                                   6,367
epel           Extra Packages for Enterprise Linux 6 - x86_64   10,899
extras         CentOS-6 - Extras                                    14
my-first-repo  My First Repo                                         1
updates        CentOS-6 - Updates                                1,009
repolist: 18,290
→ 패키지를 1개 가진 my-first-repo가 보인다.

hello 패키지 설치

======================================================================
 Package     Arch         Version           Repository           Size
======================================================================
Installing:
 hello       x86_64       1.0.0-1.el6       my-first-repo       2.5 k
 
Transaction Summary
======================================================================
Install       1 Package(s)
 
Total download size: 2.5 k
Installed size: 23  
Is this ok [y/N]: y
... (생략)
Installed:
  hello.x86_64 0:1.0.0-1.el6                                          
 
Complete!
[root@zetawiki ~]# rpm -qa hello
hello-1.0.0-1.el6.x86_64
[root@zetawiki ~]# hello
world

같이 보기

답글 남기기

이메일 주소는 공개되지 않습니다.