在RHEL6下的Yum软件仓库,可以有效的解决安装RPM分发的软件包在安装时候的依赖问题。下面是Yum数据仓库的配置方法:
1、拷贝光盘的内容到/media目录下,可以是自己磁盘空间情况而定。如果你是ISO文件,那么可以采用下面
的命令挂载:
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 内容如下:
[RHEL-server-local] #定义数据仓库的名称
name=RHEL-server-local
baseurl=file:///media/Server#指定数据仓库的位置和使用的协议,这里可以指定ftp,http,nfs等。
enabled=1 #打开数据仓库
gpgcheck=0 #不进行GPGKEY检查
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
等。
阅读(2098) | 评论(1) | 转发(1) |