[root@localhost ~]# mount /dev/cdrom /media/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# mount | tail -1/dev/sr0 on /media type iso9660 (ro)
步骤二:将本地设置为客户端,进行Yum验证
Yum客户端需编辑配置文件,命令操作如下所示:
[root@localhost ~]# cd /etc/yum.repos.d///必须在这个路径下[root@localhost yum.repos.d]# ls //此路径下事先有配置文件的模板
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo rhel6.repo //配置文件必须以.repo结尾[root@localhost yum.repos.d]# vim rhel6.repo
[rhel-6]//中括号里内容要求唯一,但不要出现特殊字符
name=RedHatEnterpriseLinux6//此为描述信息,可以看情况填写
baseurl=file:///media/ //此项为yum软件仓库位置,指向光盘挂载点
enabled=1//此项为是否开启,1为开启, 0为不开启
gpgcheck=1//此项为是否检查签名,1为检测, 0为不检测
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release //签名认证信息的路径[root@localhost /]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system isnot registered to RedHatSubscriptionManagement.You can use subscription-manager to register.
rhel-6|3.9 kB 00:00...
rhel-6/primary_db |3.1 MB 00:00...
repo id repo name status
rhel-6RedHatEnterpriseLinux63,690
repolist:3,690
对于 Linux 软件安装时提示缺失库的,可以使用 yum 的 provides 参数查看
libstdc++.so.6 的库文件包含在那个安装包中只需要执行: