# Centos 6.8 cd mount(yum install) / local repo #

인터넷이 되지 않는 환경에서

linux (Centos , redhat) 6.8 버전으로 cd mount 후 yum install 이 가능하도록 하는 작업

——————————————————————————–

[root@localhost ~]# cat /etc/redhat-release 

CentOS release 6.8 (Final)

—————————————————————————–

먼저 /mnt 밑에 dvd 를 만들겠습니다.

——————————————————————————–

[root@localhost mnt]# pwd

/mnt

[root@localhost mnt]# mkdir dvd

[root@localhost mnt]# ll

합계 4

drwxr-xr-x. 2 root root 4096 2017-11-30 13:42 dvd

——————————————————————————–

그리고 / 경로에 Centos iso 이미지를 넣겠습니다.

——————————————————————————–
[root@localhost /]# ll
합계 98
dr-xr-xr-x.   2 root root  4096 2017-07-20 16:36 bin
dr-xr-xr-x.   5 root root  1024 2017-07-20 16:39 boot
drwxr-xr-x.  19 root root  3760 2017-11-30 13:09 dev
drwxr-xr-x. 119 root root 12288 2017-11-30 13:31 etc
drwxr-xr-x.   2 root root  4096 2011-09-23 20:50 home
dr-xr-xr-x.  13 root root  4096 2017-07-20 16:36 lib
dr-xr-xr-x.   9 root root 12288 2017-07-20 16:36 lib64
drwx——.   2 root root 16384 2017-07-20 16:27 lost+found
drwxr-xr-x.   3 root root  4096 2017-11-30 13:31 media
drwxr-xr-x.   2 root root     0 2017-11-30 13:09 misc
drwxr-xr-x.   3 root root  4096 2017-11-30 13:42 mnt
drwxr-xr-x.   2 root root     0 2017-11-30 13:09 net
drwxr-xr-x.   3 root root  4096 2017-07-20 16:35 opt
dr-xr-xr-x. 162 root root     0 2017-11-30 22:08 proc
dr-xr-x—.  24 root root  4096 2017-11-30 13:31 root
dr-xr-xr-x.   2 root root 12288 2017-07-20 16:36 sbin
drwxr-xr-x.   7 root root     0 2017-11-30 22:08 selinux
drwxr-xr-x.   2 root root  4096 2011-09-23 20:50 srv
drwxr-xr-x   13 root root     0 2017-11-30 22:08 sys
drwxrwxrwt.  12 root root  4096 2017-11-30 13:31 tmp
drwxr-xr-x.  13 root root  4096 2017-07-20 16:28 usr
drwxr-xr-x.  22 root root  4096 2017-07-20 16:35 var
[root@localhost /]# rz -E
rz waiting to receive.
[root@localhost /]# 
[root@localhost /]# 
[root@localhost /]# ll
합계 3824742
-rw-r–r–.   1 root root 3916431360 2016-07-08 11:01 CentOS-6.8-x86_64-bin-DVD1.iso
dr-xr-xr-x.   2 root root       4096 2017-11-30 14:52 bin
dr-xr-xr-x.   5 root root       1024 2017-07-20 16:39 boot
drwxr-xr-x.  19 root root       3760 2017-11-30 13:09 dev
drwxr-xr-x. 119 root root      12288 2017-11-30 14:52 etc
drwxr-xr-x.   2 root root       4096 2011-09-23 20:50 home
dr-xr-xr-x.  13 root root       4096 2017-11-30 14:51 lib
dr-xr-xr-x.   9 root root      12288 2017-11-30 14:51 lib64
drwx——.   2 root root      16384 2017-07-20 16:27 lost+found
drwxr-xr-x.   3 root root       4096 2017-11-30 13:31 media
drwxr-xr-x.   2 root root          0 2017-11-30 13:09 misc
drwxr-xr-x.   3 root root       4096 2017-11-30 13:42 mnt
drwxr-xr-x.   2 root root          0 2017-11-30 13:09 net
drwxr-xr-x.   3 root root       4096 2017-07-20 16:35 opt
dr-xr-xr-x. 162 root root          0 2017-11-30 22:08 proc
dr-xr-x—.  24 root root       4096 2017-11-30 13:31 root
dr-xr-xr-x.   2 root root      12288 2017-11-30 14:52 sbin
drwxr-xr-x.   7 root root          0 2017-11-30 22:08 selinux
drwxr-xr-x.   2 root root       4096 2011-09-23 20:50 srv
drwxr-xr-x   13 root root          0 2017-11-30 22:08 sys
drwxrwxrwt.  11 root root       4096 2017-11-30 14:50 tmp
drwxr-xr-x.  13 root root       4096 2017-07-20 16:28 usr
drwxr-xr-x.  22 root root       4096 2017-07-20 16:35 var
——————————————————————————–

그다음 Centos iso 이미지를 /mnt/dvd/ 에 마운트 하겠습니다.

——————————————————————————–
[root@localhost /]# mount -t iso9660 -o loop /CentOS-6.8-x86_64-bin-DVD1.iso /mnt/dvd/
——————————————————————————–

확인

——————————————————————————–
[root@localhost /]# cd /mnt/dvd/
[root@localhost dvd]# ll
합계 558
-r–r–r–. 2 root root     14 2016-05-22 14:52 CentOS_BuildTag
dr-xr-xr-x. 3 root root   2048 2016-05-22 15:06 EFI
-r–r–r–. 2 root root    212 2013-11-27 18:36 EULA
-r–r–r–. 2 root root  18009 2013-11-27 18:36 GPL
dr-xr-xr-x. 2 root root 528384 2016-05-23 08:50 Packages
-r–r–r–. 2 root root   1359 2016-05-22 06:04 RELEASE-NOTES-en-US.html
-r–r–r–. 2 root root   1706 2013-11-27 18:36 RPM-GPG-KEY-CentOS-6
-r–r–r–. 2 root root   1730 2013-11-27 18:36 RPM-GPG-KEY-CentOS-Debug-6
-r–r–r–. 2 root root   1730 2013-11-27 18:36 RPM-GPG-KEY-CentOS-Security-6
-r–r–r–. 2 root root   1734 2013-11-27 18:36 RPM-GPG-KEY-CentOS-Testing-6
-r–r–r–. 1 root root   3380 2016-05-23 08:51 TRANS.TBL
dr-xr-xr-x. 3 root root   2048 2016-05-23 08:51 images
dr-xr-xr-x. 2 root root   2048 2016-05-22 15:06 isolinux
dr-xr-xr-x. 2 root root   4096 2016-05-23 08:51 repodata
——————————————————————————–

다음 / 경로에 repository 를 만들겠습니다.

——————————————————————————–
[root@localhost /]# mkdir repository
[root@localhost /]# ll
——————————————————————————–

다음 /mnt/dvd/ 안에 마운트한 모든 내용을 /repository 로 카피 하겠습니다.

——————————————————————————–
[root@localhost /]# cp -a /mnt/dvd/* /repository/    (시간이 좀 걸립니다.)
——————————————————————————–

다음 local repo 를 만들겠습니다.

——————————————————————————–
[root@localhost /]# vi /etc/yum.repos.d/dvd.repo
——————————————————————————–

dvd.repo 안에 하기 내용을 넣겠습니다.

——————————————————————————–
[Server]

name=Server

baseurl=file:///repository/

enabled=1

gpgcheck=0

——————————————————————————–

yum clean all 로 마무리…..

——————————————————————————–

[root@localhost /]# yum clean all

Loaded plugins: fastestmirror, refresh-packagekit, security

Cleaning repos: Server

Cleaning up Everything

Cleaning up list of fastest mirrors

——————————————————————————–

이제 yum install 이 가능한지 확인하겠습니다.

——————————————————————————–

[root@localhost /]# yum install telnet

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Install Process

Loading mirror speeds from cached hostfile

Resolving Dependencies

–> Running transaction check

—> Package telnet.x86_64 1:0.17-48.el6 will be installed

–> Finished Dependency Resolution


Dependencies Resolved


=====================================================================================================================================

 Package                      Arch                         Version                                Repository                    Size

=====================================================================================================================================

Installing:

 telnet                       x86_64                       1:0.17-48.el6                          Server                        58 k


Transaction Summary

=====================================================================================================================================

Install       1 Package(s)


Total download size: 58 k

Installed size: 109 k

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing : 1:telnet-0.17-48.el6.x86_64                                                                                       1/1 

  Verifying  : 1:telnet-0.17-48.el6.x86_64                                                                                       1/1 


Installed:

  telnet.x86_64 1:0.17-48.el6                                                                                                        


Complete!

——————————————————————————–


END

Leave a Comment