脚踏实地、勇往直前!
全部博文(1005)
分类: LINUX
2017-02-08 10:35:49
由于公司服务器不能连接网络,安装各种软件包只能通过光盘的方式安装,安装介质依赖也很麻烦,下面介绍采用本地介质作为源的yum配置。
1.进入到yum.repos.d目录
[root@host01 media]# ls -l /etc/yum.repos.d/
total 16
-rw-r--r--. 1 root root 1926 Feb 5 2016 CentOS-Base.repo
-rw-r--r--. 1 root root 638 Feb 5 2016 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 630 Feb 5 2016 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 Feb 5 2016 CentOS-Vault.repo
2.将 CentOS-Base.repo和CentOS-Debuginfo.repo两个文件改名,绕过网络安装
[root@host01 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo_bak
[root@host01 yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak
3.编辑文件CentOS-Media.repo
[root@host01 yum.repos.d]# more CentOS-Media.repo
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
4.mount光盘介质到mnt目录
mount /dev/cdrom /mnt
5.查看yum是否配置成功
yum list
6.安装软件包
yum -y install openssl-devel