RHEL6下的yum软件仓库,可以有效解决安装RPM分发的软件包时的依赖问题。
下面是Yum数据仓库的配置方法:
1、拷贝光盘的内容到/media目录下,可以是自己磁盘空间情况而定。如果你是ISO文件,那么可以采用下面
的命令挂载:
linuxjishu/9952.html target=_blank class=infotextkey>mount -o loop RHEL6.iso /mnt/cdrom
cp -ra /mnt/cdrom/* /media
2、定义数据仓库配置文件,Yum的数据仓库文件在/etc/yum.repos.d目录下。
建议将系统自带的默认的仓库文件改名(扩展名改成old),然后定义自己的数据仓库,方法如下:
cd /etc/yum.repos.d
touch server.repo
vim server.repo 内容如下:
3、使用下列命令测试数据仓库的定义:
yum install 软件包 -y #安装软件
例子:
[root@serverX yum.repos.d]# yum install ftp* -y
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package ftp-0.17-51.1.el6.x86_64 already installed and latest version
Nothing to do
[root@serverX yum.repos.d]# yum install iptraf* -y
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package iptraf.x86_64 0:3.0.1-13.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================
Package Arch Version Repository Size
================================================================================================
Installing:
iptraf x86_64 3.0.1-13.el6 RHEL-server-local 317 k
Transaction Summary
================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 317 k
Installed size: 684 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : iptraf-3.0.1-13.el6.x86_64 1/1
Installed:
iptraf.x86_64 0:3.0.1-13.el6
Complete!
常见的命令有yum list |grep "包名称"可以检测软件包是否安装。
yum erase 删除软件包
yum reinstall 重新安装软件包
yum update 更新软件包
等。
您可能感兴趣的文章:
CentOS6.3配置yum源的方法