本地yum源配置

本地yum源配置

由于单位的服务器均使用的是内网,由于不能联网故配置本地yum源配置。

1. 挂载ISO镜像文件:

将ISO镜像文件上传到服务器上,创建挂载目录。

[root@zabbix /]# mkdir linux_iso
[root@zabbix linux_iso]# mount -o loop rhel-server-6.7-x86_64-dvd.iso /media
[root@zabbix linux_iso]# ll /media
total 869
dr-xr-xr-x.  3 root root   2048 Jul  2  2015 EFI
-r--r--r--.  1 root root   8724 Nov  7  2012 EULA
-r--r--r--.  1 root root  10726 Nov  7  2012 EULA_de
-r--r--r--.  1 root root   8724 Nov  7  2012 EULA_en
-r--r--r--.  1 root root  10846 Nov  7  2012 EULA_es
-r--r--r--.  1 root root  10682 Nov  7  2012 EULA_fr
-r--r--r--.  1 root root  10497 Nov  7  2012 EULA_it
-r--r--r--.  1 root root  13173 Nov  7  2012 EULA_ja
-r--r--r--.  1 root root   9841 Nov  7  2012 EULA_ko
-r--r--r--.  1 root root  10033 Nov  7  2012 EULA_pt
-r--r--r--.  1 root root   7306 Nov  7  2012 EULA_zh
-r--r--r--.  1 root root  18092 Jun 30  2010 GPL
dr-xr-xr-x.  3 root root  12288 Jul  2  2015 HighAvailability
dr-xr-xr-x.  3 root root   2048 Jul  2  2015 images
dr-xr-xr-x.  2 root root   2048 Jul  2  2015 isolinux
dr-xr-xr-x.  3 root root   2048 Jul  2  2015 LoadBalancer
-r--r--r--.  1 root root    114 Jul  2  2015 media.repo
dr-xr-xr-x.  2 root root 690176 Jul  2  2015 Packages
-r--r--r--.  1 root root  16435 Sep  2  2010 README
dr-xr-xr-x. 25 root root   6144 Jul  2  2015 release-notes
dr-xr-xr-x.  2 root root   4096 Jul  2  2015 repodata
dr-xr-xr-x.  3 root root  14336 Jul  2  2015 ResilientStorage
-r--r--r--.  1 root root   3375 Jun 12  2015 RPM-GPG-KEY-redhat-beta
-r--r--r--.  1 root root   3211 Jun 12  2015 RPM-GPG-KEY-redhat-release
dr-xr-xr-x.  3 root root   2048 Jul  2  2015 ScalableFileSystem
dr-xr-xr-x.  3 root root   2048 Jul  2  2015 Server
-r--r--r--.  1 root root   3757 Jul  2  2015 TRANS.TBL
[root@zabbix linux_iso]# 

 

2.进入到 /etc/yum.repos.d/  :

1、利用现有文件,复制一个redhat-media.repo

[root@zabbix yum.repos.d]# cp redhat.repo redhat-media.repo
[root@zabbix yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 358 Apr 27 14:15 redhat-media.repo
-rw-r--r--. 1 root root 358 Apr 27 13:33 redhat.repo
-rw-r--r--. 1 root root 529 Jun 12  2015 rhel-source.repo

2、编辑redhat-media.repo,编辑好后保存退出。

[root@zabbix yum.repos.d]# vi redhat-media.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#
[r67media]
baseurl=file:///media
gpgcheck=0 
enabled=1 
~                                                                            

3、测试yum库安装状态

[root@zabbix yum.repos.d]# yum list | more
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'r67media' is missing name in configuration, using id
Installed Packages
ConsoleKit.x86_64                      0.4.1-3.el6                      @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ConsoleKit-libs.x86_64                 0.4.1-3.el6                      @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ConsoleKit-x11.x86_64                  0.4.1-3.el6                      @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
DeviceKit-power.x86_64                 014-3.el6                        @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ElectricFence.x86_64                   2.2.2-28.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
GConf2.x86_64                          2.28.0-6.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
GConf2-devel.x86_64                    2.28.0-6.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
GConf2-gtk.x86_64                      2.28.0-6.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
MAKEDEV.x86_64                         3.24-6.el6                       @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ModemManager.x86_64                    0.4.0-5.git20100628.el6          @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
NetworkManager.x86_64                  1:0.8.1-99.el6                   @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
NetworkManager-glib.x86_64             1:0.8.1-99.el6                   @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
NetworkManager-gnome.x86_64            1:0.8.1-99.el6                   @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ORBit2.x86_64                          2.14.17-5.el6                    @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
ORBit2-devel.x86_64                    2.14.17-5.el6                    @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
OpenEXR-libs.x86_64                    1.6.1-8.1.el6                    @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
OpenIPMI.x86_64                        2.0.16-14.el6                    @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
OpenIPMI-libs.x86_64                   2.0.16-14.el6                    @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit.x86_64                      0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-device-rebind.x86_64        0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-glib.x86_64                 0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-gstreamer-plugin.x86_64     0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-gtk-module.x86_64           0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-yum.x86_64                  0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PackageKit-yum-plugin.x86_64           0.5.8-25.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PyQt4.x86_64                           4.6.2-9.el6                      @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PyQt4-devel.x86_64                     4.6.2-9.el6                      @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
PyYAML.x86_64                          3.10-3.1.el6                     @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch
                                       7-2.el6                          @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7

到此本地yum库安装成功。

转载于:https://my.oschina.net/u/154628/blog/888303

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值