使用YUM安装SAMBA服务
Feb212012
上周已经为某客户的两台服务器(OEL5.7)安装FTP和SAMBA服务,今天客户有要求在另外两台服务器(OEL5.7和OEL6.0)上也安装FTP和SAMBA服务,在其中一台OEL6.0的服务器上安装一切正常,在另一台OEL5.7服务器上安装时出现了依赖关系。
[root@appweb1 ~]# rpm -ivh samba-3.0.33-3.14.el5.x86_64.rpm warning: samba-3.0.33-3.14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 error: Failed dependencies: samba-common = 0:3.0.33-3.14.el5 is needed by samba-3.0.33-3.14.el5.x86_64 [root@appweb1 ~]# rpm -ivh samba-common-3.0.33-3.14.el5.i386.rpm warning: samba-common-3.0.33-3.14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] file /usr/lib/libsmbclient.so.0 from install of samba-common-3.0.33-3.14.el5.i386 conflicts with file from package libsmbclient-3.0.33-3.29.el5_6.2.i386
linux虽然会用,但也不是太熟悉,看这些包都装不上去,只好用YUM啦,也很长时间没有使用YUM了,正好顺便复习下,使用YUM,当然先要配置YUM。
配置YUM有很多方法,我认为我用的这种方法是比较简单的一种,以下为简要步骤。
1.将OEL光盘插入光驱,挂载到/media目录下:
[root@appweb1 ~]# mount /dev/cdroom /media
2.在/etc/yum.repos.d目录下建立YUM的配置文件,并添加如下内容:
[root@appweb1 yum.repos.d]# vi public-yum-e15.repo [oel5] name = Enterprise Linux 5.7 DVD baseurl=file:///media/Server/ gpgcheck=0 enabled=1
3.配置好YUM后,使用yum list命令查看配置是否正确,如果不能列出光盘里的RPM包,则需要检查配置是否正确。
[root@appweb1 yum.repos.d]# yum list
4.使用YUM安装SAMBA服务包。
[root@appweb1 yum.repos.d]# yum install samba Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package samba.x86_64 0:3.0.33-3.29.el5_6.2 set to be updated -->Processing Dependency: samba-common =3.0.33-3.29.el5_6.2 for package: samba --> Running transaction check ---> Package samba-common.x86_64 0:3.0.33-3.29.el5_6.2 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================== Package Arch Version Repository Size ============================================================================== Installing: samba x86_64 3.0.33-3.29.el5_6.2 oel5 16 M Installing for dependencies: samba-common x86_64 3.0.33-3.29.el5_6.2 oel5 6.8 M Transaction Summary ============================================================================== Install 2 Package(s) Upgrade 0 Package(s) Total download size: 23 M Is this ok [y/N]: y Downloading Packages: ------------------------------------------------------------------------------ Total 9.9 GB/s | 23 MB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : samba-common 1/2 Installing : samba 2/2 Installed: samba.x86_64 0:3.0.33-3.29.el5_6.2 Dependency Installed: samba-common.x86_64 0:3.0.33-3.29.el5_6.2 Complete!
使用YUM安装服务包真的很方便,而且YUM会自动处理好依赖关系,此时SAMBA已经安装完成,简单配置下就可以使用。
[root@appweb1 samba]# vi smb.conf [root@appweb1 samba]# /etc/init.d/smb start Starting SMB services: [ OK ] Starting NMB services: [ OK ]