redhat yum ISO 本地源

先将ISO文件挂载起来:

[root@racdb1 ~]# mount -o loop /opt/soft/rhel-server-6.8-x86_64-dvd.iso /mnt/iso
[root@racdb1 ~]# df| grep iso
/opt/soft/rhel-server-6.8-x86_64-dvd.iso
3787224 3787224 0 100% /mnt/iso
[root@racdb1 ~]# mount| grep iso
/opt/soft/rhel-server-6.8-x86_64-dvd.iso on /mnt/iso type iso9660 (rw,loop=/dev/loop0)

生成文件/etc/yum.repos.d/iso.repo,同目录的其它文件可以移动位置备份起来。

root@racdb1 yum.repos.d]# pwd
/etc/yum.repos.d
[root@racdb1 yum.repos.d]#
[root@racdb1 yum.repos.d]# cat iso.repo
[iso]
name=iso
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0
[root@racdb1 yum.repos.d]#

然后初始化yum环境:

[root@racdb1 yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, security, subscription-
: manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: iso
Cleaning up Everything
[root@racdb1 yum.repos.d]# yum makecache
Loaded plugins: product-id, search-disabled-repos, security, subscription-
: manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
iso | 4.1 kB 00:00 ...
iso/group_gz | 216 kB 00:00 ...
iso/filelists_db | 3.4 MB 00:00 ...
iso/primary_db | 3.1 MB 00:00 ...
iso/other_db | 1.3 MB 00:00 ...
Metadata Cache Created

然后就可以使用yum install ... 安装包了。

上一篇:全方位解读及介绍windows网络安全及常见攻击方式


下一篇:《CSS世界》读书笔记(六)