본문 바로가기
IT/LINUX

[LINUX][RHEL6] yum repository 구성

by 양눈 2014. 8. 19.


Yum repository 구성

1. rpm 파일 수집

2. 패키지설치

yum -y install createrepo

# 설치해야 createrepo 명령사용이 가능함

 

3. 메타 데이터 생성 (특정디렉토리)

createrepo .

-- 디렉토리위치참조

http구성시 -> /var/www/html/test
ftp 구성시 -> /var/ftp/pub/test

 

3. 클라이언트 서버 설정
touch /etc/yum.repos.d/test.repo

[root@test yum.repos.d]# vi test.repo
[test]
name=test repo
baseurl=http://59.29.224.81/test
gpgcheck=0


-- 로컬구성시
baseurl=file:///var/www/html/test

 

4. yum 설치 테스트
[root@test yum.repos.d]# yum install antiword
Loaded plugins: refresh-packagekit, security
test                                                                                                                                                                   | 2.9 kB     00:00    
test/primary_db                                                                                                                                                        | 2.0 kB     00:00    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package antiword.x86_64 0:0.37-9.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================
 Package                                       Arch                                        Version                                            Repository                                 Size
==============================================================================================================================================================================================
Installing:
 antiword                                      x86_64                                      0.37-9.el6                                         test                                      148 k

Transaction Summary
==============================================================================================================================================================================================
Install       1 Package(s)

Total download size: 148 k
Installed size: 613 k
Is this ok [y/N]: y
Downloading Packages:
antiword-0.37-9.el6.x86_64.rpm                                                                                                                                         | 148 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : antiword-0.37-9.el6.x86_64                                                                                                                                                 1/1
  Verifying  : antiword-0.37-9.el6.x86_64                                                                                                                                                 1/1

Installed:
  antiword.x86_64 0:0.37-9.el6                                                                                                                                                               

Complete!
[root@test yum.repos.d]#

 


-- 어떤파일에 특정문구가 있는지 확인

[root@test linux]# yum provides */semanage
Loaded plugins: refresh-packagekit, security
policycoreutils-python-2.0.83-19.30.el6.x86_64 : SELinux policy core python utilities
Repo : base
Matched from:
Filename : /usr/sbin/semanage

policycoreutils-python-2.0.83-19.30.el6.x86_64 : SELinux policy core python utilities
Repo : installed  ->> 어떤 repository에서 가져왔는지 확인.
Matched from:
Filename : /usr/sbin/semanage

 

 

[root@station11 linux] # yum provides */lsscsi
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local/filelists_db                                                                                                                              | 3.8 MB     00:00 ...
lsscsi-0.23-2.el6.x86_64 : List SCSI devices (or hosts) and associated information
Repo        : local --> 위와 같이했을경우 Test가 나와야함
Matched from:
Filename    : /usr/bin/lsscsi

 

lsscsi-0.23-2.el6.x86_64 : List SCSI devices (or hosts) and associated information
Repo        : installed
Matched from:
Filename    : /usr/bin/lsscsi
--> 2개의 repository에서 조회됨을 확인 할수 있음.

 

 

-- repository 이름으로 설정파일 찾기
[root@test yum.repos.d]# pwd
/etc/yum.repos.d
[root@test yum.repos.d]# ll
합계 20
-rw-r--r--. 1 root       root        66 2014-07-29 15:35 anti.repo
-rw-r--r--. 1 root       root        88 2014-07-29 14:45 base.repo
-rw-r--r--. 1 4294967294 4294967294 870 2013-04-06 06:46 classroom.repo
-r--r--r--. 1 root       root        33 2014-07-27 03:13 packagekit-media.repo
-rw-r--r--. 1 root       root       529 2014-07-27 03:13 rhel-source.repo
[root@test yum.repos.d]# grep -l test *
anti.repo
[root@test yum.repos.d]#

댓글