因爲單位的服務器均使用的是內網,因爲不能聯網故配置本地yum源配置。linux
將ISO鏡像文件上傳到服務器上,建立掛載目錄。git
[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]#
一、利用現有文件,複製一個redhat-media.repobash
[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
二、編輯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 ~
三、測試yum庫安裝狀態ide
[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庫安裝成功。oop