首页 > 其他 > 详细

如何快速配置YUM源

时间:2014-02-13 02:44:41      阅读:361      评论:0      收藏:0      [点我收藏+]

1、ISO镜像插入虚拟机或者光驱

2、创建一个yum.repo文件

[root@node1 ~]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# ls 
rhel-debuginfo.repo
[root@node1 yum.repos.d]# cp rhel-debuginfo.repo yum.repo

3、编辑yum.repo文件
编辑之前

bubuko.com,布布扣
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-debuginfo-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
bubuko.com,布布扣

编辑之后 

[base]
name=Red Hat Enterprise Linux 
baseurl=file:///media/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

4、挂载光盘

[root@node1 yum.repos.d]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@node1 yum.repos.d]# 

5、通过yum进行安装软件包

bubuko.com,布布扣
[root@oggsource ~]# yum install strace
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package strace.i386 0:4.5.18-5.el5_4.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================
 Package                         Arch                          Version                                    Repository                     Size
==============================================================================================================================================
Installing:
 strace                          i386                          4.5.18-5.el5_4.1                           base                          171 k

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

Total download size: 171 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : strace                                                                                                                 1/1 

Installed:
  strace.i386 0:4.5.18-5.el5_4.1                                                                                                              

Complete!
[root@oggsource ~]# 
bubuko.com,布布扣

6、操作完成

如何快速配置YUM源

原文:http://www.cnblogs.com/arcer/p/3546353.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!