配置本地yum源

转载 2013年12月01日 21:39:53

摘要:当我们使用光盘安装系统以后,还有很多包没有安装,此时,我们可以将那些包配置成本地的源,方便以后的安装。让然,你可以更懒惰一点,直接把那些包拷贝过来,然后使用rpm -ivh的命令进行安装。本文,主要根据RHEL6.4和centos5.8两个版本,讲解了本地yum源的搭建方法。


 

1.挂载iso到/mnt目录下 

mount -o loop rhel6.iso /mnt

mount /dev/cdrom /mnt

 

2.创建repos和 修改 yumRepo.py配置文件


2.1centos 5.8

mount /dev/cdrom /mnt

cd /etc/yum.repos.d/

cp CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bk

#vi CentOS-Debuginfo.repo 
[debug]
name=CentOS-5 - Debuginfo
#baseurl=http://debuginfo.centos.org/5/$basearch/
baseurl=file:///mnt
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
enabled=1

#vi /usr/lib/python2.4/site-packages/yum/yumRepo.py
remote = url + ‘/’ + relative  787行
为 
remote = "/mnt" + ‘/’ + relative


2.2)redhat6.4
vi /etc/yum.repos.d/rhel-debuginfo.repo 
[Server] 
name=Red Hat Enterprise Linux Server 
baseurl=file:///mnt 
enabled=1 
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

vi /usr/lib/python2.6/site-packages/yum/yumRepo.py

remote = url + ‘/’ + relative  802行

remote = "/mnt" + ‘/’ + relative


4.安装rpm包测试本地yum源是否可用


redhat6.4安装成功表示搭建本地源成功

redhat6#yum install mysql (安装测试本地yum源是否可用)
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.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.i686 0:5.1.66-2.el6_3 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch           Version                  Repository        Size
================================================================================
Installing:
 mysql           i686           5.1.66-2.el6_3           Server           895 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 895 k
Installed size: 2.3 M
Is this ok [y/N]: 


centos 5.8 安装成功表示搭建本地源成功

[root@contos yum.repos.d]# yum install mysql
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
debug                                                                                                  | 1.3 kB     00:00     
debug/primary                                                                                          | 1.2 MB     00:00     
debug                                                                                                               3595/3595
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.i386 0:5.0.77-4.el5_6.6 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
---> Package mysql.x86_64 0:5.0.77-4.el5_6.6 set to be updated
--> Running transaction check
---> Package perl-DBI.x86_64 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================
 Package                      Arch                       Version                              Repository                 Size
==============================================================================================================================
Installing:
 mysql                        i386                       5.0.77-4.el5_6.6                     debug                     4.8 M
 mysql                        x86_64                     5.0.77-4.el5_6.6                     debug                     4.8 M
Installing for dependencies:
 perl-DBI                     x86_64                     1.52-2.el5                           debug                     600 k

Transaction Summary
==============================================================================================================================
Install       3 Package(s)
Upgrade       0 Package(s)

Total download size: 10 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------
Total                                                                                          85 MB/s |  10 MB     00:00     
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
debug/gpgkey                                                                                           | 1.5 kB     00:00     
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBI                                                                                               1/3 
  Installing     : mysql                                                                                                  2/3 
  Installing     : mysql                                                                                                  3/3 

Installed:
  mysql.i386 0:5.0.77-4.el5_6.6                                mysql.x86_64 0:5.0.77-4.el5_6.6                               

Dependency Installed:
  perl-DBI.x86_64 0:1.52-2.el5                                                                                                

Complete!

相关文章推荐

Redhat-配置YUM源

  • 2017-09-23 19:13
  • 86KB
  • 下载

linux下本地yum源配置

  • 2015-04-28 16:14
  • 38KB
  • 下载

配置yum本地源

转自:http://jingyan.baidu.com/article/e9fb46e1aed8207521f7662c.html 法一。 放入Centos6.4的镜像光盘或找到镜像文件 mou...

RedHat5配置yum源.doc

  • 2012-12-18 18:37
  • 37KB
  • 下载

redhat下配置yum源

  • 2017-06-13 13:38
  • 21KB
  • 下载

RHEL6配置yum源

问题背景:     起源于试图使用yum安装mongodb。原因是,通过安装包安装的时候,虚拟机中的系统,总是会提示各种依赖版本低于要求的提示,然后是无限的手动安装更新。。。 所以无奈,只好使用yum...

yum源配置讲解

  • 2014-09-08 10:31
  • 37KB
  • 下载

linux 光盘yum源配置文件

  • 2011-04-17 00:57
  • 10KB
  • 下载

RHEL 7.0 yum源配置

一、设置IP地址、网关DNS 说明:RHEL 7.0默认安装好之后是没有自动开启网络连接的! cd  /etc/sysconfig/network-scripts/  #进入网络配置文...

yum源的配置

  • 2012-03-29 11:05
  • 56KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)