本安装过程是利用光盘挂载建立源进行安装。
1.首先要在虚拟机上挂载虚拟光盘。
2.利用安装的光盘建立源。
[roo@localhost 桌面]$ su root 密码: [root@localhost 桌面]# mkdir /cdrom mkdir: 无法创建目录"/cdrom": 文件已存在 [root@localhost 桌面]# mount /dev/cdrom /cdrom mount: /dev/sr0 写保护,将以只读方式挂载 [root@localhost 桌面]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# vi dvd.repo #源配置文件的内容 [DVD-Local] name=DVD Localbaseurl=file:///cdrom/ enable = 1 gpgcheck= 1 gpgkey=file:///cdrom/RPM-GPG-KEY-redhat-release [root@localhost yum.repos.d]# yum clean all 已加载插件:langpacks, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 正在清理软件源: DVD-Local Cleaning up everything [root@localhost yum.repos.d]# yum makecache 已加载插件:langpacks, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. DVD-Local | 4.1 kB 00:00 (1/5): DVD-Local/group_gz | 134 kB 00:00 (2/5): DVD-Local/primary_db | 3.4 MB 00:00 (3/5): DVD-Local/filelists_db | 3.0 MB 00:00 (4/5): DVD-Local/other_db | 1.3 MB 00:00 (5/5): DVD-Local/productid
3.安装软件包
[root@localhost yum.repos.d]# yum install httpd 已加载插件:langpacks, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 正在解决依赖关系 --> 正在检查事务 ---> 软件包 httpd.x86_64.0.2.4.6-17.el7 将被 安装 --> 正在处理依赖关系 httpd-tools = 2.4.6-17.el7,它被软件包 httpd-2.4.6-17.el7.x86_64 需要 --> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-17.el7.x86_64 需要 --> 正在处理依赖关系 libapr-1.so.0()(64bit),它被软件包 httpd-2.4.6-17.el7.x86_64 需要 --> 正在处理依赖关系 libaprutil-1.so.0()(64bit),它被软件包 httpd-2.4.6-17.el7.x86_64 需要 --> 正在检查事务 ---> 软件包 apr.x86_64.0.1.4.8-3.el7 将被 安装 ---> 软件包 apr-util.x86_64.0.1.5.2-6.el7 将被 安装 ---> 软件包 httpd-tools.x86_64.0.2.4.6-17.el7 将被 安装 ---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 ================================================================================ Package 架构 版本 源 大小 ================================================================================ 正在安装: httpd x86_64 2.4.6-17.el7 DVD-Local 1.2 M 为依赖而安装: apr x86_64 1.4.8-3.el7 DVD-Local 103 k apr-util x86_64 1.5.2-6.el7 DVD-Local 92 k httpd-tools x86_64 2.4.6-17.el7 DVD-Local 77 k mailcap noarch 2.1.41-2.el7 DVD-Local 31 k 事务概要 ================================================================================ 安装 1 软件包 (+4 依赖软件包) 总下载量:1.5 M 安装大小:4.3 M Is this ok [y/d/N]: y Downloading packages: 警告:/cdrom/Packages/apr-1.4.8-3.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID fd431d51: NOKEY apr-1.4.8-3.el7.x86_64.rpm 的公钥尚未安装 -------------------------------------------------------------------------------- 总计 11 MB/s | 1.5 MB 00:00 从 file:///cdrom/RPM-GPG-KEY-redhat-release 检索密钥 导入 GPG key 0xFD431D51: 用户ID : "Red Hat, Inc. (release key 2)" 指纹 : 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51 来自 : /cdrom/RPM-GPG-KEY-redhat-release 是否继续?[y/N]:y 导入 GPG key 0x2FA658E0: 用户ID : "Red Hat, Inc. (auxiliary key) " 指纹 : 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0 来自 : /cdrom/RPM-GPG-KEY-redhat-release 是否继续?[y/N]:y Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : apr-1.4.8-3.el7.x86_64 1/5 正在安装 : apr-util-1.5.2-6.el7.x86_64 2/5 正在安装 : httpd-tools-2.4.6-17.el7.x86_64 3/5 正在安装 : mailcap-2.1.41-2.el7.noarch 4/5 正在安装 : httpd-2.4.6-17.el7.x86_64 5/5 验证中 : mailcap-2.1.41-2.el7.noarch 1/5 验证中 : httpd-tools-2.4.6-17.el7.x86_64 2/5 验证中 : apr-1.4.8-3.el7.x86_64 3/5 验证中 : apr-util-1.5.2-6.el7.x86_64 4/5 验证中 : httpd-2.4.6-17.el7.x86_64 5/5 已安装: httpd.x86_64 0:2.4.6-17.el7 作为依赖被安装: apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-17.el7 mailcap.noarch 0:2.1.41-2.el7 完毕!
4.卸载软件包
yum remove httpd
好了。今天的分享就到这了。点个赞吧(需要虚拟光盘的可以加QQ:2647996100)。



