Chinaunix首页 | 论坛 | 博客
  • 博客访问: 83588
  • 博文数量: 12
  • 博客积分: 126
  • 博客等级: 入伍新兵
  • 技术积分: 190
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-13 22:53
文章分类

全部博文(12)

文章存档

2015年(1)

2014年(2)

2013年(4)

2012年(2)

2011年(3)

我的朋友

分类: LINUX

2013-08-23 16:17:19

 1.mount本地CentOS光盘
#mount /dev/cdrom   /mnt/cdrom

2.修改yum配置
#cd /etc/yum.repos.d

# cat CentOS-Media.repo
-------------------------------------------------------------------------------
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c5-media [command]
#  
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c5-media [command]
 
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/recorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
-------------------------------------------------------------------------------

修改该配置文件:

将baseurl指向mount的光盘
...
baseurl=file:///mnt/cdrom/
...

3.运行安装命令安装软件包。(下面是示例安装gd-devel软件包)

[root@localhost yum.repos.d]#  yum --disablerepo=\* --enablerepo=c5-media install gd-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gd-devel.i386 0:2.0.33-9.4.el5_4.2 set to be updated
--> Processing Dependency: freetype-devel for package: gd-devel
--> Processing Dependency: fontconfig-devel for package: gd-devel
--> Running transaction check
---> Package fontconfig-devel.i386 0:2.4.1-7.el5 set to be updated
---> Package freetype-devel.i386 0:2.2.1-21.el5_3 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                            Arch                   Version                                Repository                  Size
===================================================================================================================================
Installing:
 gd-devel                           i386                   2.0.33-9.4.el5_4.2                     c5-media                    97 k
Installing for dependencies:
 fontconfig-devel                   i386                   2.4.1-7.el5                            c5-media                   168 k
 freetype-devel                     i386                   2.2.1-21.el5_3                         c5-media                   146 k

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

Total download size: 412 k
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              159 MB/s | 412 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : freetype-devel                                                                                              1/3 
  Installing     : fontconfig-devel                                                                                            2/3 
  Installing     : gd-devel                                                                                                    3/3 

Installed:
  gd-devel.i386 0:2.0.33-9.4.el5_4.2                                                                                               

Dependency Installed:
  fontconfig-devel.i386 0:2.4.1-7.el5                             freetype-devel.i386 0:2.2.1-21.el5_3                            

Complete!
[root@localhost yum.repos.d]# 
阅读(3728) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~