共計 3180 個字符,預計需要花費 8 分鐘才能閱讀完成。
這篇文章主要介紹如何使用安裝光盤的 rpm 作為 yum 源的文件,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
yum 源的安裝:使用安裝光盤作為本地的 yum 源
1、
掛載所需要的安裝光盤
虛擬機掛載光盤:
設置 - 光盤 - 路徑(在“連接”處打勾)
[root@oracle ~]# mount /dev/cdrom -o loop /mnt
– 將光盤掛載到 /mnt 目錄下
2、
切換至 yum.repo.d 目錄下,備份所有.repo 結尾的文件,只留或新創建一個任意文件名后綴為.repo 的文件,并編輯
[root@oracle ~]# cd /etc/yum.repos.d/
[root@oracle ~]# vi server.repo
[server]
name=OEL54
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
–name 名稱可以任意取
–baseurl 為光盤掛載到本地的 rpm 包對應的目錄
3、
執行 yum list all 驗證 yum 倉庫是否配置好。
若開始配置錯了,用 yum clean all 清理后,再次執行 yum list all。以上 /mnt/Server 就是光盤掛載后出現的目錄,安裝光盤的目錄結構參考如下順序
[root@ocptest media]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 6.0G 20G 23% /
tmpfs 1.8G 0 1.8G 0% /dev/shm
/dev/hdc 2.8G 2.8G 0 100% /media/Enterprise Linux dvd 20090908
/dev/hdc 2.8G 2.8G 0 100% /mnt
[root@ocptest media]# ll /dev/cdrom
lrwxrwxrwx 1 root root 3 Mar 9 00:55 /dev/cdrom – hdc
[root@ocptest mnt]# ll /mnt
total 518
-rw-r–r– 2 root root 5165 Sep 9 2009 blafdoc.css
drwxr-xr-x 3 root root 2048 Sep 9 2009 Cluster
drwxr-xr-x 3 root root 4096 Sep 9 2009 ClusterStorage
-rw-r–r– 11 root root 7037 Sep 9 2009 EULA
-rw-r–r– 2 root root 7037 Sep 9 2009 eula.en_US
-rw-r–r– 2 root root 3334 Sep 9 2009 eula.py
-rw-r–r– 11 root root 18390 Sep 9 2009 GPL
drwxr-xr-x 4 root root 2048 Sep 9 2009 images
drwxr-xr-x 2 root root 2048 Sep 9 2009 isolinux
-rw-r–r– 2 root root 3957 Sep 9 2009 README-en
-rw-r–r– 2 root root 8394 Sep 9 2009 README-en.html
-rw-r–r– 2 root root 14639 Sep 9 2009 RELEASE-NOTES-en
-rw-r–r– 2 root root 36477 Sep 9 2009 RELEASE-NOTES-en.html
-rw-r–r– 11 root root 1397 Sep 9 2009 RPM-GPG-KEY
-rw-r–r– 2 root root 1397 Sep 9 2009 RPM-GPG-KEY-oracle
drwxr-xr-x 4 root root 401408 Sep 9 2009
Server
-rw-r–r– 2 root root 105 Sep 9 2009 supportinfo
-r–r–r– 1 root root 4436 Sep 9 2009 TRANS.TBL
drwxr-xr-x 3 root root 4096 Sep 9 2009 VT
[root@ocptest media]# ll /mnt/Server/
total 2551136
-rw-r–r– 2 root root 1205237 Jan 22 2009 a2ps-4.13b-57.2.el5.i386.rpm
-rw-r–r– 2 root root 68916 Jan 22 2009 acl-2.2.39-3.el5.i386.rpm
-rw-r–r– 2 root root 23972 Jul 11 2009 acpid-1.0.4-9.el5.i386.rpm
-rw-r–r– 2 root root 651232 Jan 22 2009 adaptx-0.9.13-3jpp.1.i386.rpm
…
公司可以自建一個 yum 的倉庫,比如把 http://192.168.1.2/centos6 當成一個 yum 倉庫
[root@oatest ~]# cat /etc/yum.repos.d/one.repo
[localyum]
name=centos6
baseurl=http://192.168.1.2/centos6
enable=1
gpgcheck=0
兩個 ISO 文件安裝的 OS 的情況下,配置如下
[root@oatest ~]# cat /etc/yum.repos.d/one.repo
[myself]
name=myself
baseurl=file:///co6.8_media01
file:///co6.8_media02
enabled=1
gpgcheck=0
[root@oatest ~]# ll /co6.8_media01
total 558
-r–r–r–. 2 root root 14 May 22 2016 CentOS_BuildTag
dr-xr-xr-x. 3 root root 2048 May 22 2016 EFI
-r–r–r–. 2 root root 212 Nov 27 2013 EULA
-r–r–r–. 2 root root 18009 Nov 27 2013 GPL
dr-xr-xr-x. 3 root root 2048 May 23 2016 images
dr-xr-xr-x. 2 root root 2048 May 22 2016 isolinux
dr-xr-xr-x. 2 root root 528384 May 23 2016 Packages
-r–r–r–. 2 root root 1359 May 22 2016 RELEASE-NOTES-en-US.html
dr-xr-xr-x. 2 root root 4096 May 23 2016 repodata
-r–r–r–. 2 root root 1706 Nov 27 2013 RPM-GPG-KEY-CentOS-6
-r–r–r–. 2 root root 1730 Nov 27 2013 RPM-GPG-KEY-CentOS-Debug-6
-r–r–r–. 2 root root 1730 Nov 27 2013 RPM-GPG-KEY-CentOS-Security-6
-r–r–r–. 2 root root 1734 Nov 27 2013 RPM-GPG-KEY-CentOS-Testing-6
-r–r–r–. 1 root root 3380 May 23 2016 TRANS.TBL
以上是“如何使用安裝光盤的 rpm 作為 yum 源的文件”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注丸趣 TV 行業資訊頻道!