2021-05-12 14:32:11
RHEL7.0設定CD-ROM為本地YUM
RHEL7.0安裝初始預設沒有任何yum 源,以掛載本地DVD到/mnt/cdrom,將系統yum源連線到/mnt/cdrom為例。
# 用yum-config-manager生成一個原始檔模版
[root@server0 yum.repos.d]# yum-config-manager --add-repo=cdrom
Loaded plugins: langpacks, product-id
adding repo from: cdrom
[cdrom]
name=added from: cdrom
baseurl=cdrom
enabled=1
# 將生成的模版編輯如下
[root@server0 yum.repos.d]# cat cdrom.repo
[cdrom]
name=DVD Media
baseurl=file:///mnt/cdrom
enabled=1
# 掛載CDROM
[root@server0 yum.repos.d]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
# 匯入RPM-GPG-KEY
[root@server0 yum.repos.d]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-xxxx
# 檢視
[root@server0 ~]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
cdrom DVD Media 4,305
repolist: 4,305
更多YUM相關教學見以下內容:
RedHat 6.2 Linux修改yum源免費使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm
設定EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm
Redhat 本地yum源設定 http://www.linuxidc.com/Linux/2012-11/75127.htm
yum的組態檔說明 http://www.linuxidc.com/Linux/2013-04/83298.htm
RedHat 6.1下安裝yum(圖文) http://www.linuxidc.com/Linux/2013-06/86535.htm
YUM 安裝及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm
CentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm
相關文章