감사합니다.
CentOS 7.6 Local Repository 본문
인터넷을 사용할 수 없는 환경에서 패키지를 설치해야하는 경우 운영체제 ISO 파일을 사용하여 로컬 서버에 yum repository를 생성해 본다.
- mount cdrom or ISO
[root@centos76 /]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@centos76 /]#
[root@centos76 /]# ls -lrt /mnt
total 686
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r--. 1 root root 18009 Dec 10 2015 GPL
-rw-rw-r--. 1 root root 227 Aug 30 2017 EULA
-rw-rw-r--. 1 root root 14 Nov 26 01:01 CentOS_BuildTag
drwxr-xr-x. 2 root root 2048 Nov 26 01:20 LiveOS
drwxr-xr-x. 2 root root 2048 Nov 26 01:20 isolinux
drwxr-xr-x. 3 root root 2048 Nov 26 01:20 EFI
drwxr-xr-x. 3 root root 2048 Nov 26 01:21 images
drwxrwxr-x. 2 root root 663552 Nov 26 08:52 Packages
drwxrwxr-x. 2 root root 4096 Nov 26 08:53 repodata
-r--r--r--. 1 root root 2883 Nov 26 08:54 TRANS.TBL
[root@centos76 /]#
2. File Copy
[root@centos76 localrepo]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/CentOS76--VG01-root 47G 3.9G 43G 9% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 4.0K 1.9G 1% /dev/shm
tmpfs 1.9G 10M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 947M 178M 770M 19% /boot
/dev/mapper/CentOS76--VG01-data01 249G 4.4G 245G 2% /data01
tmpfs 378M 4.0K 378M 1% /run/user/42
tmpfs 378M 72K 378M 1% /run/user/0
tmpfs 378M 0 378M 0% /run/user/1000
/dev/sr0 4.3G 4.3G 0 100% /mnt
[root@centos76 /]# cp /mnt/* /data01/localrepo/
3. 설정 파일 백업
[root@centos76 /]# cd /etc/yum.repos.d/
[root@centos76 yum.repos.d]# ls -lrt
total 32
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 630 Nov 23 22:16 CentOS-Media.repo
-rw-r--r--. 1 root root 314 Nov 23 22:16 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
[root@centos76 yum.repos.d]#
[root@centos76 yum.repos.d]# mkdir repo.bakup
[root@centos76 yum.repos.d]#
[root@centos76 yum.repos.d]# mv ./C* ./repo.bakup/
[root@centos76 yum.repos.d]#
4. 설정 파일 구성
[root@centos76 yum.repos.d]# vi centos-local.repo
[root@centos76 yum.repos.d]#
[root@centos76 yum.repos.d]# cat centos-local.repo
[local]
name=localrepository
baseurl=file:///data01/localrepo
enabled=1
gpgcheck=0
[root@centos76 yum.repos.d]#
5. 설정 확인
[root@centos76 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
local | 3.6 kB 00:00
(1/2): local/group_gz | 166 kB 00:00
(2/2): local/primary_db | 3.1 MB 00:00
repo id repo name status
local localrepository 4,021
repolist: 4,021
[root@centos76 yum.repos.d]#
'Linux' 카테고리의 다른 글
RHEL6 - Multipath 설정 정리하기 (0) | 2019.04.10 |
---|---|
Storsimple & Linux : iSCSI - MPIO 구성 (0) | 2018.06.19 |
2TB 이상의 디스크 사용하기 (0) | 2018.06.19 |
iSCSI Mount (0) | 2018.06.18 |
vmstat 성능 수집하기 (0) | 2018.06.14 |
sysbench 사용법 (0) | 2018.02.23 |