OS CD 삽입 후 진행

 

cd에 있는 패키지를 담을 경로 생성

mkdir -p /localrepo

 

cd 파일을 해당 디렉토리로 복사

cp -rv /run/media/root/OL-7.6\ Server.x86_64/Packages/ /localrepo/

 

기존 Online Repository 설정 파일 이름 변경

[root@rac1 ~]# cd /etc/yum.repos.d/
[root@rac1 yum.repos.d]# ls -alrt
total 32
drwxr-xr-x.   2 root root    54  1월 30 15:40 .
drwxr-xr-x. 145 root root  8192  1월 30 15:32 ..
-rw-r--r--.   1 root root 13093 11월  2  2018 public-yum-ol7.repo
[root@rac1 yum.repos.d]# mv public-yum-ol7.repo public-yum-ol7.repobak

 

새로운 로컬 repository 설정

[root@rac1 yum.repos.d]# vi /etc/yum.repos.d/local.repo 
[local]
name=localrepository
baseurl=file:///localrepo/
enabled=1
gpgcheck=0

 

Local Repository 업데이트

[root@rac1 yum.repos.d]# createrepo /localrepo/
Spawning worker 0 with 5241 pkgs
yum clean all
 
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

 

/localrepo 디렉토리 밑에 repodata 디렉토리가 생겼는지 확인

[root@rac1 yum.repos.d]# ls -alrt /localrepo/
합계 352
drwxr-xr-x.  4 root root     38  1월 30 15:41 .
dr-xr-xr-x. 18 root root   4096  1월 30 15:37 ..
drwxr-xr-x.  2 root root 274432  1월 30 15:39 Packages
drwxr-xr-x.  2 root root   4096  1월 30 15:41 repodata

 

repomd.xml 파일이 생성되었는지 확인

[root@rac1 yum.repos.d]# cd /localrepo/repodata/
[root@rac1 repodata]# ls
2229e465c089ad17a9c470a22502116def92d4cb4c82b33b6200a9384db7c763-primary.sqlite.bz2
35b5a30cc34c9d2db21706541b6885d8c6d047c2de39d4bda5b2c98b8afea27c-other.xml.gz
7739df8a74574ba6ca9d54f913cf91b96aaa80eb495eabf8575c5225b78e9404-primary.xml.gz
8d34ced6e2b49dcf62b34796c553434c8a95d9d5dfffce6fe26b06e5b410c9ec-filelists.sqlite.bz2
ce3b2889a285d2910c8e5a30387183c5188e9606d61ba62c865c12035ac1bbc8-filelists.xml.gz
fad50d91cc416a3498f898cc298d64fc34b345c5cea9a5877493452d5dd5feec-other.sqlite.bz2
repomd.xml

 

기존 yum data 삭제

[root@rac1 repodata]# yum clean all

 

repolist 불러오기

[root@rac1 repodata]# yum repolist

 

패키지 설치

yum install -y [패키지명]

 

참조: https://positivemh.tistory.com/470

+ Recent posts