装了个Redhat Enterprise 5.6,习惯了Centos的yum,想重新建立一个yum本地源,记录下步骤:
1、安装createrepo软件包
2、创建软件包的目录,如:/data/rhel/,并把ISO文件中的所有信息拷贝到此目录下,如cp -r /mnt/* /data/rhel/
3、创建repo信息:
createrepo -g /data/rhel/Server/repodata/comps-rhel5-sever-core.xml 创建基础软件包
createrepo -g /data/rhel/VT/repodata/comps-rhel5-vt.xml 虚拟化
createrepo -g /data/rhel/Clust/repodata/comps-rhel5-cluster.xml 集群
createrepo -g /data/rhel/ClusterStorage/repodata/comps-rhel5-cluster-st.xml 集群虚拟化
-g参数是为了创建分组信息,在添加删除程序或者groupinstall的分组信息
4、安装apache,并配置到 /data/rhel
5、删除/etc/yum.repo.d/目录下的所有文件,并编写文件rhel-local.repo,只要保证文件名以.repo结尾即刻,文件内容如下:
[rhel-local] name=Red Hat Enterprise Linux $releasever - $basearch baseurl=http://localhost/Server/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [rhel-VT] name=Red Hat Enterprise Linux $releasever - $basearch baseurl=http://localhost/VT/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [rhel-Cluster] name=Red Hat Enterprise Linux $releasever - $basearch baseurl=http://localhost/Cluster/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [rhel-ClusterStorage] name=Red Hat Enterprise Linux $releasever - $basearch baseurl=http://localhost/ClusterStorage/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
6、yum makecache就可以了
7、测试