Linux&MySQL&PHP&Nginx&Apache&MSSQL&Shell
分类: LINUX
2010-08-02 13:35:20
1:挂载光盘,挂载后在/media里
2:mkdir /yum
3:cp –avf /media/RHEL5.4 i386 DVD/{Cluster,ClusterStorage,Server,VT} /yum
4:安装ceraterepo命令 rpm –ivh /media/RHEL5.4 i386 DVD/Server/ceraterepo-*
5:创建mkdir –p /var/RHEL5/{Cluster,ClusterStorage,Server,VT}
6:生成repodata
#createrpo –o /var/RHEL5/Cluster –g /yum/Cluster/ repodata/comps-rhel5-cluster.xml /yum/Cluster
#createrpo –o /var/RHEL5/ClusterStorage –g /yum/ClusterStorage/ repodata/ comps-rhel5-cluster-st.xml /yum/ClusterStorage
#createrpo –o /var/RHEL5/Server –g /yum/Server/ repodata/ comps-rhel5-server-core.xml /yum/Server
#createrpo –o /var/RHEL5/VT –g /yum/VT/ repodata/ comps-rhel5-vt.xml /yum/VT
7:vi /etc/yum/repos.d/rhel-local.repo或/etc/yum.repos.d/CentOS-Base.repo
加入以下内容
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=file:/// yum/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=file:/// yum /ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:/// yum /Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=file:/// yum /VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
8:yum clean all
安装rpm包 yum install .rpm
注释:
CentOS下有的时候用yum安装软件的时候最后会提示:引用warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID***** 这是由于yum安装了旧版本的GPG keys造成的,解决办法就是引用rpm --import /etc/pki/rpm-gpg/RPM* 再安装软件就不会有这个错误提示了。
或者: /etc/yum.repos.d/CentOS-Base.repo
gpgcheck=1 全部改为gpgcheck=0