RHEL5/6 加载 DVD yum源
2016-04-26 19:33
337 查看
RHEL 5.8 加载 DVD yum源
[root@localhost Server]# pwd/media/RHEL_5.8 x86_64 DVD/Server
[root@localhost Server]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 16
-rw-r--r-- 1 root root 205 Apr 26 17:23 redhat-dvd.repo
-rw-r--r-- 1 root root 190 Apr 26 17:23 redhat.repo
-rw-r--r-- 1 root root 254 Jan 24 2012 rhel-debuginfo.repo
[root@localhost yum.repos.d]# vi redhat-dvd.repo
[redhat-dvd]
name=Red Hat Enterprise Linux $releasever - $basearch - DVD
baseurl=file:///media/RHEL_5.8%20x86_64%20DVD/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rhel-dvd-Server | 1.5 kB 00:00
rhel-dvd-Server/primary | 920 kB 00:00
rhel-dvd-Server 3285/3285
repo id repo name status
rhel-dvd-Server Red Hat Enterprise Linux x86 - Server
file路径内不能出现空格,空格需用%20代替,否则会出现以下报错。
[root@localhost yum.repos.d]# vi redhat-dvd.repo
redhat-dvd]
name=Red Hat Enterprise Linux $releasever - $basearch - DVD
baseurl=file:///media/RHEL_5.8 x86_64 DVD/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Options Error: Error parsing 'file:///media/RHEL_5.8 x86_64 DVD/Server': URL must be http, ftp, file or https not ""
使用转义符\,空格需用%20代替,否则会出现以下报错。
[root@localhost yum.repos.d]# vi redhat-dvd.repo
redhat-dvd]
name=Red Hat Enterprise Linux $releasever - $basearch - DVD
baseurl=file:///media/RHEL_5.8\ x86_64\ DVD/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Options Error: Error parsing 'file:///media/RHEL_5.8\\ x86_64\\ DVD/Server': URL must be http, ftp, file or https not ""
RHEL 6.4 加载 DVD yum源
挂载本地光盘到系统:把rhel6 安装光盘放入光驱,在终端命令行下操作[root@llocalhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.7G 2.9G 6.3G 32% /
tmpfs 2.4G 372K 2.4G 1% /dev/shm
/dev/sda1 1008M 60M 898M 7% /boot
/dev/sda5 67G 12G 52G 19% /u01
/dev/sr0 3.5G 3.5G 0 100% /media/RHEL_6.4 x86_64 Disc 1
[root@localhost ~]# cd /media/RHEL_6.4\ x86_64\ Disc\ 1/
[root@localhost RHEL_6.4 x86_64 Disc 1]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# vi redhat-dvd.repo
[rhel-media]
name=Red Hat Enterprise Linux 6.2 #自定义名称
baseurl=file:///media/RHEL_6.4\ x86_64\ Disc\ 1/ #本地光盘挂载路径
enabled=1 #启用yum源,0为不启用,1为启用
gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查
gpgkey=file:///media/rhel/RPM-GPG-KEY-redhat-release #GPG-KEY路径
清除yum缓存,使用yum install自动安装软件
[root@localhost yum.repos.d]# yum clean all #清除yum缓存
[root@localhost ~]# yum install php #安装php
相关文章推荐
- DataSet调用Dispose必须吗
- 编码识别工具:hash-identifier
- Flex,Flash,AS3,AIR的关系和区别(转载)
- 4.20作业
- 20160426 Python视频教程
- HDU 5656 CA Loves GCD
- C++第四次作业
- html5+开发移动app
- Calendar时间操作
- java 面向对象编程(OOP)-个人理解
- 为什么 Python 不支持函数重载?
- vi编辑器的使用方法
- iOS Crash文件的解析(一)
- mysql修改编码格式
- 第六次作业
- ZOJ 3938-Defuse the Bomb【模拟,题看着挺长】(2016浙江省大学生程序设计竞赛)
- 【框架】RefreshListView下拉刷新
- 公式加括号的所有可能
- 给大家共享一个个人认为非常好的动画网站
- keras代码阅读-Activition层