【Linux】Linux軟體安裝管理5 掛載本地iso光碟映象、配置yum軟體倉庫

dbasdk發表於2016-03-28
Linux軟體安裝管理5
掛載本地iso光碟映象、配置yum軟體倉庫


當操作異地機房裡的伺服器,使用rpm命令進行軟體包安裝時,不方便解決依賴關係
配置yum軟體倉庫,使用yum安裝軟體可以自動處理依賴關係
將系統光碟上傳到伺服器上,linux掛載iso光碟映象檔案,配置yum軟體倉庫

1 上傳iso檔案
使用xftp上傳rhel6.4系統光碟映象到/software


[root@rhel64 ~]# cd /software/
[root@rhel64 software]# ls -lh



為方便使用,重新命名光碟映象檔案
[root@rhel64 software]# mv rhel-server-6.4-x86_64-dvd.iso rhel64.iso
[root@rhel64 software]# ls -lh


2 建立掛載點
[root@rhel64 ~]# mkdir /mnt/yum
[root@rhel64 ~]# ls -ld /mnt/yum


3 臨時掛載iso檔案

[root@rhel64 ~]# df -Th


直接執行mount命令,提示使用-o loop選項
[root@rhel64 ~]# mount /software/rhel64.iso /mnt/yum/


[root@rhel64 ~]# mount -o loop /software/rhel64.iso /mnt/yum
[root@rhel64 ~]# df -Th


解除安裝
[root@rhel64 ~]# umount /mnt/yum

[root@rhel64 ~]# df -Th


4 實現iso檔案開機自動掛載
編寫/etc/fstab檔案,追加寫入資訊

/software/rhel64.iso    /mnt/yum                iso9660 loop            0 0

[root@rhel64 ~]# vi /etc/fstab


[root@rhel64 ~]# grep iso /etc/fstab


執行mount -a命令,掛載驗證
[root@rhel64 ~]# mount -a
[root@rhel64 ~]# df -Th


重啟作業系統驗證
[root@rhel64 ~]# reboot


[root@rhel64 ~]# df -Th


5 配置yum軟體倉庫
[root@rhel64 ~]# cat /etc/yum.repos.d/rhel-source.repo


[root@rhel64 ~]# yum clean all
[root@rhel64 ~]# yum info zsh





呂星昊
2016.3.24


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29475508/viewspace-2063193/,如需轉載,請註明出處,否則將追究法律責任。

相關文章