0
点赞
收藏
分享

微信扫一扫

centos本地yum源配置方法

1.    放入Centos6.4的镜像光盘或找到镜像文件

mount –o loop –t iso9660 CentOS-6.0-i386-bin-DVD.iso

mount /dev/cdrom  /media/cdrom

centos本地yum源配置方法_linux

2.    2

编辑repo文件:

cd  /etc/yum..repos.d

(文件位置/etc/yum.repos.d/,后缀一定是.repo结束.为了使用自己搭建的yum源我这里删除了自带的(rm –f  ./*

centos本地yum源配置方法_本地源_02

3.    3

2.编辑自己的repo文件

[root@helomeyum.repos.d]# vim local.repo后缀)

[local_server](库名称)

name= this is a local repo (名称描述)

baseurl=file:///media/dvd(yum源目录,源地址)

enabled=1(是否启用该yum源,0为禁用)

gpgcheck=0  (检查GPG-KEY,0为不检查,1为检查)

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6(gpgcheck=0时无需配置)

保存退出!

centos本地yum源配置方法_linux_03

4.    4

5.    5

[root@helome yum.repos.d]# yum clean all清除缓存)

Loaded plugins: fastestmirror, refresh-packagekit, security

Cleaning repos: local_server

Cleaning up Everything

Cleaning up list of fastest mirrors

[root@helome yum.repos.d]# yum makecache (建立新缓存)

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

local_server                                             |4.0 kB     00:00 ...

local_server/group_gz                                    | 209kB     00:00 ...

local_server/filelists_db                                | 4.8 MB     00:00 ...

local_server/primary_db                                  | 3.5 MB     00:00 ...

local_server/other_db                                    | 2.0MB     00:00 ...

Metadata Cache Created

[root@helome yum.repos.d]#

centos本地yum源配置方法_本地源_04

6.    6

3.这下可以使用yum本地源了

Test: yuminstall –y sendmail

centos本地yum源配置方法_linux_05

7.    7

到此yum本地源安装结束

 

举报

相关推荐

0 条评论