本地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 /mediatotal 869dr-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 GPLdr-xr-xr-x. 3 root root 12288 Jul 2 2015 HighAvailabilitydr-xr-xr-x. 3 root root 2048 Jul 2 2015 imagesdr-xr-xr-x. 2 root root 2048 Jul 2 2015 isolinuxdr-xr-xr-x. 3 root root 2048 Jul 2 2015 LoadBalancer-r--r--r--. 1 root root 114 Jul 2 2015 media.repodr-xr-xr-x. 2 root root 690176 Jul 2 2015 Packages-r--r--r--. 1 root root 16435 Sep 2 2010 READMEdr-xr-xr-x. 25 root root 6144 Jul 2 2015 release-notesdr-xr-xr-x. 2 root root 4096 Jul 2 2015 repodatadr-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-releasedr-xr-xr-x. 3 root root 2048 Jul 2 2015 ScalableFileSystemdr-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]# lltotal 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:///mediagpgcheck=0 enabled=1 ~
3、测试yum库安装状态
[root@zabbix yum.repos.d]# yum list | moreLoaded plugins: product-id, refresh-packagekit, security, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Repository 'r67media' is missing name in configuration, using idInstalled PackagesConsoleKit.x86_64 0.4.1-3.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ConsoleKit-libs.x86_64 0.4.1-3.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ConsoleKit-x11.x86_64 0.4.1-3.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7DeviceKit-power.x86_64 014-3.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ElectricFence.x86_64 2.2.2-28.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7GConf2.x86_64 2.28.0-6.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7GConf2-devel.x86_64 2.28.0-6.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7GConf2-gtk.x86_64 2.28.0-6.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7MAKEDEV.x86_64 3.24-6.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ModemManager.x86_64 0.4.0-5.git20100628.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7NetworkManager.x86_64 1:0.8.1-99.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7NetworkManager-glib.x86_64 1:0.8.1-99.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7NetworkManager-gnome.x86_64 1:0.8.1-99.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ORBit2.x86_64 2.14.17-5.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7ORBit2-devel.x86_64 2.14.17-5.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7OpenEXR-libs.x86_64 1.6.1-8.1.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7OpenIPMI.x86_64 2.0.16-14.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7OpenIPMI-libs.x86_64 2.0.16-14.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-device-rebind.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-glib.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-gstreamer-plugin.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-gtk-module.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-yum.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PackageKit-yum-plugin.x86_64 0.5.8-25.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PyQt4.x86_64 4.6.2-9.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PyQt4-devel.x86_64 4.6.2-9.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7PyYAML.x86_64 3.10-3.1.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch 7-2.el6 @anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7
到此本地yum库安装成功。