Linux软件安装管理5
挂载本地iso光盘镜像、配置yum软件仓库
挂载本地iso光盘镜像、配置yum软件仓库
当操作异地机房里的服务器,使用rpm命令进行软件包安装时,不方便解决依赖关系
配置yum软件仓库,使用yum安装软件可以自动处理依赖关系
将系统光盘上传到服务器上,linux 挂载iso光盘镜像文件,配置yum软件仓库
1 上传iso文件
使用xftp上传rhel6.4系统光盘镜像到/software
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_14588034869CTR.png?x-oss-process=style/bb)
[root@rhel64 ~]# cd /software/
[root@rhel64 software]# ls -lh
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803513Whih.png?x-oss-process=style/bb)
为方便使用,重命名光盘镜像文件
[root@rhel64 software]# mv rhel-server-6.4-x86_64-dvd.iso rhel64.iso
[root@rhel64 software]# ls -lh
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803530e8zP.png?x-oss-process=style/bb)
2 创建挂载点
[root@rhel64 ~]# mkdir /mnt/yum
[root@rhel64 ~]# ls -ld /mnt/yum
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803546mSD9.png?x-oss-process=style/bb)
3 临时挂载iso文件
[root@rhel64 ~]# df -Th
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803558MvPv.png?x-oss-process=style/bb)
直接执行mount命令,提示使用-o loop选项
[root@rhel64 ~]# mount /software/rhel64.iso /mnt/yum/
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803601eH9U.png?x-oss-process=style/bb)
[root@rhel64 ~]# mount -o loop /software/rhel64.iso /mnt/yum
[root@rhel64 ~]# df -Th
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803615s6wj.png?x-oss-process=style/bb)
卸载
[root@rhel64 ~]# umount /mnt/yum
[root@rhel64 ~]# df -Th
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458803632pUJ0.png?x-oss-process=style/bb)
4 实现iso文件开机自动挂载
编写/etc/fstab文件,追加写入信息
/software/rhel64.iso /mnt/yum iso9660 loop 0 0
[root@rhel64 ~]# vi /etc/fstab
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_145880406346Vp.png?x-oss-process=style/bb)
[root@rhel64 ~]# grep iso /etc/fstab
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458804121AI85.png?x-oss-process=style/bb)
执行mount -a命令,挂载验证
[root@rhel64 ~]# mount -a
[root@rhel64 ~]# df -Th
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458804139AbXu.png?x-oss-process=style/bb)
重启操作系统验证
[root@rhel64 ~]# reboot
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458804153bah6.png?x-oss-process=style/bb)
[root@rhel64 ~]# df -Th
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458804161TT4G.png?x-oss-process=style/bb)
5 配置yum软件仓库
[root@rhel64 ~]# cat /etc/yum.repos.d/rhel-source.repo
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_14588042344lY3.png?x-oss-process=style/bb)
[root@rhel64 ~]# yum clean all
[root@rhel64 ~]# yum info zsh
![](http://img.blog.itpub.net/blog/attachment/201603/24/29475508_1458804250kZXg.png?x-oss-process=style/bb)
吕星昊
2016.3.24
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29475508/viewspace-2063193/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29475508/viewspace-2063193/