Red Hat 6.3配置本地YUM源

1、首先新建本地YUM源文件夹

[root@xt02 ~]# mkdir -p /software/localyum/

2、将光盘放入光驱,将光盘内的文件拷贝到新建的yum源文件夹

[root@xt02 ~]# cp -vr /media/RHEL_6.3\ x86_64\ Disc\ 1/* /software/localyum/

3、在/etc/yum.repos.d/下新建localyum.repo(本地yum源配置文件),并加入如下配置

[root@xt02 yum.repos.d]# vim localyum.repo
[LOCAL_YUM_RESOURCE]
name=$HOSTNAME Local YUM Resource
baseurl=file:///software/localyum/
gpgcheck=0
enable=1

注意: 文件夹中的其他 repo文件建议拷贝走,或者末尾加.bak

4、清除本地yum源历史信息

[root@xt02 yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Bad id for repo: xt02 LOCAL YUM RESOURCE, byte =   6
Cleaning repos: InstallMedia
Cleaning up Everything

5、列出本地新的yum源信息,若可以列出,则本地yum源新建成功

[root@xt02 yum.repos.d]# yum list all

可以成功列出yum资源包,至此,本地yum源配置成功

你可能感兴趣的:(Red Hat 6.3配置本地YUM源)