We generally install the Linux operating system to minimize the installation, we need to install something in the back of the use of Yum to install some associated libraries. Do you have a cluster, don't want or need to get a Yum source server.
Original blog from: www.51niux.com bo: Busy Firewood less
At this time we consider the first case, our server is not online now, to yum installation of things are basically the system comes with, this time we consider the Yum local CD installation.
My operating system is CentOS 6.4, take this as an example.
1. Mount the disc
[Email protected] ~]# Mkdir/tmp/cdrom #创建要挂载光盘的目录
[Email protected] ~]# Mount/dev/cdrom/tmp/cdrom #挂载光盘镜像
2. Change the Yum source configuration file
[Email protected] cdrom]# cd/etc/yum.repos.d/#进入到yum源配置文件目录
[Email protected] yum.repos.d]# tar zcf repos.tar.gz * #将所有的配置文件打包备份
[Email protected] yum.repos.d]# RM-RF centos-* #删除所有的yum源配置文件
[Email protected] yum.repos.d]# vim Centos-media.rep #重新创建一个光盘yum源配置文件
[Centos6.4-media]
name=centos-$releasever-media
Baseurl=file:///tmp/cdrom #光盘的挂载目录
Gpgcheck=1 #1为启动检测GPG-key,0 for not checking
Enabled=1 #是否启用yum源
Gpgkey=file:///tmp/cdrom/rpm-gpg-key-centos-6 #制定挂载目录下的GPG-key file, gpgcheck=0 without configuration
3. Verify the results
[Email protected] yum.repos.d]# Ping www.baidu.com #现在解析不了域名
Ping:unknown Host Www.baidu.com
[email protected] yum.repos.d]# Yum Clean all #清除yum缓存
[[email protected] yum.repos.d]# Yum install mysql-server-y #yum安装一下mysql下面是结果, some of the associated library files are downloaded as well.
Now that the local disc yum source configuration is complete, I see online there is a way to use the Createrepo command to create a yum warehouse, here is not introduced, after all, this local disc method is not commonly used.
Original blog from: www.51niux.com bo: Busy Firewood less
This article from "Technology in the progress of sharing" blog, declined reprint!
Centos 6.4 Build Local disc yum