centos本地yum安装出错
用yum使用本地的repo进行安装时总是出错:
Setting up Group Process
Setting up repositories
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for setuptool to pack into transaction set.
media://1195929648.203590%231/CentOS/setuptool-1.19.2-1.el5.centos.x86_64.rpm: [Errno 4] IOError: <urlopen error unknown url type: media>
Trying other mirror.
Error: failed to retrieve CentOS/setuptool-1.19.2-1.el5.centos.x86_64.rpm from base
error was [Errno 4] IOError: <urlopen error unknown url type: media>
从这里发现media:xxx这样的东东不太对头,显然是xml中有了问题。所以来好好的从头搞。首先,我们需要重新建一下repo中的文件:
createrepo /home/soft/centos5.1
这样在repodata目录中就出现了
-rw-r--r-- 1 root root 3372868 Mar 4 14:26 filelists.xml.gz
-rw-r--r-- 1 root root 9451641 Mar 4 14:26 other.xml.gz
-rw-r--r-- 1 root root 1106208 Mar 4 14:26 primary.xml.gz
-rw-r--r-- 1 root root 1142 Mar 4 14:27 repomd.xml
这些文件。
在.olddata中存了原来的group的信息,所以我们将group的信息放过来:
cp /home/soft/centos5.1/.olddata/comps.xml /home/soft/centos5.1/repodata/
这样我们就有了group的说明。但是yum grouplist还是会显示没有group,哪是因为在repomd.xml中没有对comps.xml的引用说明。将以下内容加到repomd.xml中去,加到repomd域中:
<data type="group">
<location href="repodata/comps.xml"/>
<checksum type="sha">10b04b72722ee9ad6113c00740df75aa2b7168e6</checksum>
<timestamp>1195928547</timestamp>
</data>
这样你就可以使用这个repo了。
最后给出一个我自己使用的yum.conf:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
gpgcheck=0
obsoletes=1
reposdir=/dev/null
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
#name=CentOS-$releasever - Media
name=CentOS-5.1 - Base
baseurl=file:///home/soft/centos5.1
enabled=1
[updates]
name=CentOS-5.1 - Updates
baseurl=file:///home/soft/centos5.1
enabled=1
引用通告 (0)
下面所列出的是引用这篇文章: centos本地yum安装出错 的Blog链接.
这篇文章的引用通告URL: http://mt.opensource.org.cn/cgi-bin/mt/mt-tb.cgi/261

发表评论