环境:VMware workstation
系统:rh6.5
一、首先,查看镜像光盘是否被读取
二、挂载配置
新建挂在目录
mkdir -p /mnt/media
挂在光盘 mount /dev/cdrom /mnt/media/
提示
mount: block device /dev/sr0 is write-protected, mounting read-only 挂载成功
同时可 df -h 可查看到相关磁盘信息
/dev/sr0 3.6G 3.6G 0 100% /mnt/media
为防止服务器关机或者重启后,仍需手动挂载,更改为自动挂载
vi /etc/fstab
添加以下配置信息
/dev/cdrom /mnt/media iso9660 defaults 0 0
保存退出
mount -a 重新挂载
df -h重新查看是否可以看到之前的磁盘信息,可以看到及表示配置完成。
修改yum配置文件
cd /etc/yum.repos.d/
只保留一个.repo结尾的配置文件,其他备份后删除
vi rhel-source.repo
name=Red Hat Enterprise Linux $releasever - $basearch - Source #此处自定义名称,可不修改
baseurl=file:///mnt/media #此处本地光盘挂载路径(注意:本地镜像路径为file://+挂载目录)
enabled=1 #此处0为不启动,1为启动
gpgcheck=0 #是否检查GPG-KEY,0为不检查,1为检查
修改完毕后,保存
yum repolist查看是否有以下相关信息,
[root@weblogic yum.repos.d]# yum repolist
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.
repo id repo name status
rhel-source Red Hat Enterprise Linux 6Server - x86_64 - Source 3,690
repolist: 3,690
如何有,则配置成功,开始yum安装。
测试:
[root@weblogic yum.repos.d]# yum install lrzsz -y
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.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Installing:
lrzsz x86_64 0.12.20-27.1.el6 rhel-source 71 k
Transaction Summary
===================================================================================================================================================
Install 1 Package(s)
Total download size: 71 k
Installed size: 159 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lrzsz-0.12.20-27.1.el6.x86_64 1/1
rhel-source/productid | 1.7 kB 00:00 ...
Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-27.1.el6
Complete!
配置安装完成。
阅读(1332) | 评论(0) | 转发(0) |