红联Linux门户
Linux帮助

用rpmdb和yum解决依赖问题

发布时间:2008-02-17 01:18:15来源:红联作者:dwillin
发现一个问题,发上来给大家讨论和参考一下。在rhel5当中取消了rpmdb包(其实在fc4中就已经取消了),rpmdb主要是解决在安装包时的依赖关系。

您可以通过一下方法查看究竟有没有安装rpmdb包(以下信息代表已经安装。)

引用:
[root@linux RPMS]# rpm -qa|grep rpmdb
rpmdb-redhat-4-0.20050107


那么如何使用呢。比如安装as4自带的apache时有很多依赖需要解决,那么大家可以使用以下命令来解决?

引用:
[root@linux RPMS]# rpm -ivh httpd-2.0.52-9.ent.i386.rpm
warning: httpd-2.0.52-9.ent.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
httpd-suexec is needed by httpd-2.0.52-9.ent.i386
Suggested resolutions:
httpd-suexec-2.0.52-9.ent.i386.rpm


以上是报错依赖包需要安装。那么我们可以使用rpmdb工具来自动解决依赖。

引用:
[root@linux RPMS]# rpm -ivh --aid httpd-2.0.52-9.ent.i386.rpm
warning: httpd-2.0.52-9.ent.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:httpd ########################################### [ 50%]
2:httpd-suexec ########################################### [100%]


安装完成了。

那现在没有rpmdb怎么办呢?我们可以使用新的yum工具来完成

组件包的安装都是通过yum所以要对yum进行配置

具体在命令行下操作如下:[code]1. mount -o loop rhel-5-server-dvd.iso /media/rhel

2. vi /etc/yum.repos.d/rhel-local.repo

[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=file:///media/rhel/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:///media/rhel/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:///media/rhel/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:///media/rhel/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

3. mkdir -p /var/rhel/{Cluster,ClusterStorage,Server,VT}

4. createrepo -o /var/rhel/Cluster -g /media/rhel/Cluster/repodata/comps-rhel5-cluster.xml /media/rhel/Cluster
createrepo -o /var/rhel/ClusterStorage -g /media/rhel/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /media/rhel/ClusterStorage
createrepo -o /var/rhel/Server -g /media/rhel/Server/repodata/comps-rhel5-server-core.xml /media/rhel/Server
createrepo -o /var/rhel/VT -g /media/rhel/VT/repodata/comps-rhel5-vt.xml /media/rhel/VT

5. mount --bind /var/rhel/Cluster/repodata /media/rhel/Cluster/repodata
mount --bind /var/rhel/ClusterStorage/repodata /media/rhel/ClusterStorage/repodata
mount --bind /var/rhel/Server/repodata /media/rhel/Server/repodata
mount --bind /var/rhel/VT/repodata /media/rhel/VT/repodata

6. yum clean all[/code]
文章评论

共有 0 条评论