[root@Rocky ~]# ls /opt/
rocky-8.5-x86_64-dvd1.iso
  • 3.编辑配置文件
[root@Rocky ~]# cd /etc/yum.repos.d/
[root@Rocky yum.repos.d]# cp Rocky-Media.repo bak.repo
[root@Rocky yum.repos.d]# rm -rf Rocky*
[root@Rocky yum.repos.d]# ls
bak.repo
[root@Rocky yum.repos.d]#vi bak.repo
# Rocky-Media.repo
#
# You can use this repo to install items directly off the installation media.
# Verify your mount point matches one of the below file:// paths.
[media-baseos]
name=Rocky Linux $releasever - Media - BaseOS
baseurl=file:///media/Rocky/BaseOS
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
[media-appstream]
name=Rocky Linux $releasever - Media - AppStream
baseurl=file:///media/Rocky/AppStream
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
~                                                                   
  • 4.创建挂载所需路径
[root@Rocky yum.repos.d]# mkdir /media/Rocky
  • 5.挂载到/media/Rocky
[root@Rocky yum.repos.d]# mount -o loop /opt/rocky-8.5-x86_64-dvd1.iso /media/Rocky/
mount: /media/Rocky: WARNING: device write-protected, mounted read-only.
[root@Rocky yum.repos.d]# df 
Filesystem     1K-blocks     Used Available Use% Mounted on
devtmpfs          912548        0    912548   0% /dev
tmpfs             930248        0    930248   0% /dev/shm
tmpfs             930248     8572    921676   1% /run
tmpfs             930248        0    930248   0% /sys/fs/cgroup
/dev/vda3       36681220 12289600  24391620  34% /
/dev/vda1        1038336   207832    830504  21% /boot
tmpfs             186048        0    186048   0% /run/user/0
/dev/loop0      10464680 10464680         0 100% /media/Rocky
  • 6.清除yum缓存进行安装测试
[root@Rocky yum.repos.d]# yum clean all
27 files removed
[root@Rocky yum.repos.d]# yum -y install bind 
Rocky Linux 8 - Media - BaseOS                                                    61 MB/s | 2.6 MB     00:00    
Rocky Linux 8 - Media - AppStream                                                 87 MB/s | 7.5 MB     00:00    
Last metadata expiration check: 0:00:01 ago on Mon 02 May 2022 09:19:21 PM CST.
Dependencies resolved.
=================================================================================================================
 Package                      Architecture       Version                       Repository                   Size
=================================================================================================================
Installing:
 bind                         x86_64             32:9.11.26-6.el8              media-appstream             2.1 M
Installing dependencies:
 bind-libs                    x86_64             32:9.11.26-6.el8              media-appstream             173 k
 bind-libs-lite               x86_64             32:9.11.26-6.el8              media-appstream             1.2 M
 bind-license                 noarch             32:9.11.26-6.el8              media-appstream             101 k
 fstrm                        x86_64             0.6.1-2.el8                   media-appstream              28 k
 libmaxminddb                 x86_64             1.2.0-10.el8                  media-appstream              32 k
 protobuf-c                   x86_64             1.3.0-6.el8                   media-appstream              36 k
Installing weak dependencies:
 geolite2-city                noarch             20180605-1.el8                media-appstream              19 M
 geolite2-country             noarch             20180605-1.el8                media-appstream             1.0 M
Transaction Summary
=================================================================================================================
Install  9 Packages
Total size: 24 M
Installed size: 65 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                         1/1 
  Installing       : protobuf-c-1.3.0-6.el8.x86_64                                                           1/9 
  Installing       : fstrm-0.6.1-2.el8.x86_64                                                                2/9 
  Installing       : bind-license-32:9.11.26-6.el8.noarch                                                    3/9 
  Installing       : geolite2-country-20180605-1.el8.noarch                                                  4/9 
  Installing       : geolite2-city-20180605-1.el8.noarch                                                     5/9 
  Installing       : libmaxminddb-1.2.0-10.el8.x86_64                                                        6/9 
  Running scriptlet: libmaxminddb-1.2.0-10.el8.x86_64                                                        6/9 
  Installing       : bind-libs-lite-32:9.11.26-6.el8.x86_64                                                  7/9 
  Installing       : bind-libs-32:9.11.26-6.el8.x86_64                                                       8/9 
  Running scriptlet: bind-32:9.11.26-6.el8.x86_64                                                            9/9 
  Installing       : bind-32:9.11.26-6.el8.x86_64                                                            9/9 
  Running scriptlet: bind-32:9.11.26-6.el8.x86_64                                                            9/9 
  Verifying        : bind-32:9.11.26-6.el8.x86_64                                                            1/9 
  Verifying        : bind-libs-32:9.11.26-6.el8.x86_64                                                       2/9 
  Verifying        : bind-libs-lite-32:9.11.26-6.el8.x86_64                                                  3/9 
  Verifying        : bind-license-32:9.11.26-6.el8.noarch                                                    4/9 
  Verifying        : fstrm-0.6.1-2.el8.x86_64                                                                5/9 
  Verifying        : geolite2-city-20180605-1.el8.noarch                                                     6/9 
  Verifying        : geolite2-country-20180605-1.el8.noarch                                                  7/9 
  Verifying        : libmaxminddb-1.2.0-10.el8.x86_64                                                        8/9 
  Verifying        : protobuf-c-1.3.0-6.el8.x86_64                                                           9/9 
Installed:
  bind-32:9.11.26-6.el8.x86_64                             bind-libs-32:9.11.26-6.el8.x86_64                     
  bind-libs-lite-32:9.11.26-6.el8.x86_64                   bind-license-32:9.11.26-6.el8.noarch                  
  fstrm-0.6.1-2.el8.x86_64                                 geolite2-city-20180605-1.el8.noarch                   
  geolite2-country-20180605-1.el8.noarch                   libmaxminddb-1.2.0-10.el8.x86_64                      
  protobuf-c-1.3.0-6.el8.x86_64                           
Complete!
  • 7.大功告成!祝大家在Rocky的路上越走越远!
Logo

更多推荐