Redhat Enterprise Server6.1下的yum安装源的配置主要分为一下几个步骤: 服务器配置 挂载镜像文件: 在mnt目录下创建rhel6.1文件夹存放镜像文件 [iyunv@huboss mnt]# mkdir rhel6.1
[iyunv@huboss ~]# mount /dev/cdrom /mnt/rhel6.1
[iyunv@huboss ~]# cd /mnt/rhel6.1/Packages/
安装vsftpd包: [iyunv@huboss Packages]# rpm -ivh vsftpd-2.2.2-6.el6_0.1.x86_64.rpm
安装完成后,在/var/ftp/pub目录会自动生成 然后根据虚拟机的硬盘大小,选择时候是要复制rhel镜像还是每次mount,这里我们选择复制镜像到/var/ftp/pub目录下 [iyunv@huboss Packages]# cp -r /mnt/rhel6.1 /var/ftp/pub/ 关闭防火墙: [iyunv@huboss rhel6.1]# service iptables stop
好,现在服务端的配置就完成了,下面进行客户端的配置
客户端配置 配置repo文件: [iyunv@rhel61-hubo ~]# cd /etc/yum.repos.d/
[iyunv@rhel61-hubo yum.repos.d]# cp rhel-source.repo ftpyum.repo
[iyunv@rhel61-hubo yum.repos.d]# vi ftpyum.repo
内容如下: [rhel-source] name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
修改baseurl、enabled、gpgcheck baseurl=ftp://192.168.1.240/pub/rhel6.1/Server #地址为服务器的地址
enabled=1
gpgcheck=0
保存并退出
好,现在客户端的配置就完成了,你可以尝试各种yum install xxx
PS yum clean all 清除原来的yum源缓存数据 yum list 查看所有已经安装的软件 yum grouplist 查看安装的和没有安装的软件组的情况 yum install *** (*代表你要安装的软件的名字) yum groupinstall ***(*代表你要安装的软件组的名字,可以使用yum grouplist查看哪些安装了,哪些没有安装。如果组名字中间有空格,注意使用双引号给引起来) yum groupinstall 是个很好用的工具,使用yum grouplist可以查看可安装的包和已经安装的包,比如说安装完后发现没有安装桌面,则可以使用这两个命令了。 yum groulist可以找到 gnome 、 X Window、Desktop 那么使用yum groupinstall 安装,具体方法是: yum groupinstall “X Window” yum groupinstall Desktop yum groupinsatll gnome
更多使用方法,建议使用man yum 查看
|