1,概述
yum(yellow dog Updater Modified)是由Duke University所发起的计划,目的是为了解决RPM的包依赖问题。
服务器端:在服务器上面存放了所有的RPM软件包,然后通过命令分析每个RPM文件的依赖关系,将这些数据记录成文件放在服务器上(HTTP,FTP等
方式)。
客户端:如果需要安装某个软件时,通过YUM服务器上的记录的依赖关系文件,下载依赖关系需要的所有相关的软件,自动全部安装下载下来进行安
装。
2,安装配置
2.1FTP服务器作为YUM源。
1,安装并配置vsftpd服务器
yum -y install vsftpd
service vsftpd start
2确认系统中是否安装YUM服务器工具
[root@localhost pub]# rpm -qa|grep yum
yum-updatesd-0.9-2.el5
yum-fastestmirror-1.1.16-13.el5.centos
yum-metadata-parser-1.1.2-3.el5.centos
yum-3.2.22-20.el5.centos
3.使用命令安装createrepo.该软件包用于生成RPM依赖关系及分组信息。
rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
4,将光盘中部分内容复制到/var/ftp/pub/Centos目录下
cp -rv Centos /var/ftp/pub
5,生成RPM包依赖关系。
cp repomd.xml /var/ftp/pub/CentOS/ 复制文件,该文件记录了所在目录所有RPM包的依赖关系。
cp comps.xml /var/ftp/pub/CentOS/ 复制文件 该文件记录了分组信息
cp -rf repodata /var/ftp/pub/CentOS/
-g
参数 1生成依赖关系2是可以跟新分组文件信息
createrepo -g /var/ftp/pub/CentOS/repodata/comps.xml /v
ar/ftp/pub/CentOS/
结果
2535/2535 - libibmad-static-1.2.3-1.el5.i386.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
=========================================
3.客户端设置
在/etc/yum.repos.d/Centos-Base.repo文件中增加如下内容
[yumtest]
name=Server
baseurl=ftp://172.16.3.64/pub/CentOS
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
4,测试安装
[root@test2 yum.repos.d]# yum -y install mysql*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package mysql-server-5.0.77-3.el5.i386 already installed and latest version
Package mysql-5.0.77-3.el5.i386 already installed and latest version
Package mysql-connector-odbc-3.51.26r1127-1.el5.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package mysql-bench.i386 0:5.0.77-3.el5 set to be updated
---> Package mysql-devel.i386 0:5.0.77-3.el5 set to be updated
---> Package mysql-test.i386 0:5.0.77-3.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================
Package Arch Version Repository Size
=====================================================================================
Installing:
mysql-bench i386 5.0.77-3.el5 yumtest 507 k
mysql-devel i386 5.0.77-3.el5 yumtest 2.4 M
mysql-test i386 5.0.77-3.el5 yumtest 3.7 M
Transaction Summary
=====================================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 6.6 M
Downloading Packages:
(1/3): mysql-bench-5.0.77-3.el5.i386.rpm | 507 kB 00:00
(2/3): mysql-devel-5.0.77-3.el5.i386.rpm | 2.4 MB 00:00
(3/3): mysql-test-5.0.77-3.el5.i386.rpm | 3.7 MB 00:01
-------------------------------------------------------------------------------------
Total 3.7 MB/s | 6.6 MB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-devel 1/3
Installing : mysql-bench 2/3
Installing : mysql-test
3/3
Installed:
mysql-bench.i386 0:5.0.77-3.el5 mysql-devel.i386 0:5.0.77-3.el5
mysql-test.i386 0:5.0.77-3.el5
Complete!
阅读(1641) | 评论(0) | 转发(0) |