新聞中心
yum,全稱“Yellow dog Updater, Modified”,是一個專門為了解決包的依賴關(guān)系而存在的軟件包管理器。就好像 Windows 系統(tǒng)上可以通過 360 軟件管家實(shí)現(xiàn)軟件的一鍵安裝、升級和卸載,Linux 系統(tǒng)也提供有這樣的工具,就是 yum,下面為大家講解一下 RHEL6配置本地YUM源具體方法。

為玉州等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及玉州網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站設(shè)計、網(wǎng)站制作、外貿(mào)營銷網(wǎng)站建設(shè)、玉州網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
一:掛載本地光盤到系統(tǒng)
如果服務(wù)器是虛擬機(jī),可以通過vSphere Client進(jìn)入控制平臺,在“編輯設(shè)置”——>“硬件”——>“CD/DVD驅(qū)動器”里指定操作系統(tǒng)的ISO鏡像文件。如果是物理機(jī),則需要進(jìn)入機(jī)房找到服務(wù)器,在光驅(qū)里面放入安裝光盤。這個相對而言比較麻煩,所以一般最好復(fù)制光盤文件到本地硬盤。
方法1:光驅(qū)掛載鏡像
[root@getlnx06 ~]# mkdir /mnt/cdrom
[root@getlnx06 ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@getlnx06 ~]#
方式2:復(fù)制光盤文件
文件/tmp/rehl6.tar.gz是從光盤打包復(fù)制過來的,順便解壓到到指定目錄/mnt/cdrom
[root@localhost ~]# mkdir /mnt/cdrom/
[root@localhost ~]tar zxvf /tmp/rehl6.tar.gz -C /mnt/cdrom/
二:配置本地YUM源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
redhat.repo rhel-source.repo
[root@localhost yum.repos.d]touch rhel-media.repo
[root@localhost yum.repos.d]# vi rhel-media.repo
[media]
name=Red Hat Enterprise Linux 6.6
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
清除原有緩存
[root@localhost ~]# yum clean all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: media
Cleaning up Everything
獲取yum列表
驗(yàn)證yum配置是否成功
[root@localhost ~]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
media | 4.1 kB 00:00 ...
media/group_gz | 211 kB 00:00 ...
media/filelists_db | 3.3 MB 00:00 ...
media/primary_db | 3.1 MB 00:00 ...
media/other_db | 1.4 MB 00:00 ...
Metadata Cache Created
[root@localhost ~]#
驗(yàn)證yum配置是否成功
[root@localhost ~]# yum grouplist | grep Server Network Infrastructure Server Server Platform Web Server Backup Server Directory Server Identity Management Server Network Storage Server Print Server Server Platform Development
小問題:
在yum配置文件里,如果忘記添加添加yum源的名字,則有可能報下面錯誤。
[root@getlnx06 yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Error: File contains no section headers.
file: file:///etc/yum.repos.d/rhel-media.repo, line: 1
‘name=Red Hat Enterprise Linux 6.6 \n’
本文題目:RHEL6配置本地YUM源
網(wǎng)站地址:http://fisionsoft.com.cn/article/dpppiie.html


咨詢
建站咨詢
