web-dev-qa-db-ja.com

CentOSで「リポジトリメタデータ(repomd.xml)を取得できません」を修正する方法

yum update yumyum clean allを試しましたが、どちらも次の問題の解決には役立ちません。

# yum install httpd --installroot=/opt/httpd2
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile  
    * rpmforge: repoforge.spinellicreations.com
http://centos.karan.org/el%24releasever/extras/stable/x86_64/RPMS/repodata/repomd.xml:
[Errno 14] HTTP Error 404: Not Found 
Trying other mirror. 
Error: Cannot retrieve repository metadata (repomd.xml) for repository: 
    kbs-CentOS-Extras.
Please verify its path and try again

また、kbs-CentOS-Extrasの.repoファイルを/etc/yum.repos.dから削除し、変更を加えずにコマンドを再実行してみました。念のため、ここに私のシステム情報を示します。

# uname -a
Linux 2.6.18-274.3.1.el5xen #1 SMP Tue Sep 6 20:57:11 EDT 2011 x86_64 GNU/Linux

現在、.repoファイルを使用しています ここで提供 。これが私の/etc/yum.confです。

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/yum5bug
timeout=300
installonly_limit = 5

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

yum.logファイルは空ですが、/var/cache/yum/kbs-CentOS-Miscにはrepomd.xmlが含まれています-これはおそらくリモートコピーの代わりに使用できますか?

そうでない場合、私がこれをどのように解決できるかについての提案はありますか?

1
Rob

リポジトリ名のel%24releasever変数名を$ releaseverに修正します。 yum変数の詳細については、 yum.conf を確認してください。

変数

Yumの構成ファイルの保守を容易にするために使用できる変数がいくつかあります。これらは、name、baseurl、およびコマンドを含むいくつかのオプションの値で使用できます。

$releasever This will be replaced with the value of the version of the package listed in distroverpkg. This defaults to the version of

「redhat-release」パッケージ。

$Arch This will be replaced with your architecture as listed by os.uname()[4] in Python.

$basearch This will be replaced with your base architecture in yum. For example, if your $Arch is i686 your $basearch will be i386.

$uuid This will be replaced with a unique but persistent uuid for this machine. The value that is first generated will be stored in

/ var/lib/yum/uuid。このファイルが削除されるまで再利用されます。

$YUM0-$YUM9 These will be replaced with the value of the Shell environment variable of the same name. If the Shell environment

変数が存在しない場合、構成ファイル変数は置き換えられません。 3.2.28以降、/ etc/yum/vars内のファイルはすべて、ファイル名にちなんで名付けられた変数に変換されます(または上記の変数をオーバーライドします)。

ファイルが読み取れない場合は警告/エラーが表示されないため、rootだけが読み取ることができるファイルを作成すると、ユーザーを混乱させる可能性があることに注意してください。

また、便宜上、最初の行だけが読み取られ、改行文字はすべて削除されることに注意してください。ただし、データに対して他のチェックは実行されません。つまり、どの値にも不正な文字データが含まれている可能性があります。

また このトピック は、yum変数を理解するのに役立ちます。

1
efesaid

CentALT x86_64 リポジトリを追加することで、この問題を回避できました。私は最初に centalt-release-5-3.noarch.rpm をダウンロードし、次に実行しました:

rpm -Uvh centalt-release*rpm

この後、元のコマンドを実行すると、パッケージの競合が発生しました(別のインストールディレクトリにある場合でも、httpd-toolsの別のバージョンを再インストールしていたのは不満でした)。

私はテスト目的で/opt/httpd2にのみインストールしていたため、そのアイデアを放棄し、yum upgrade httpdを実行して正常にインストールしました。

0
Rob