2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

yum で Error: File contains no section headers. って出たときの対応

Posted at

はじめに

  • ちょっとした問題に合ったのでメモとして。
  • yumできるものを確認しようとして、listされなくなったときの対処法です

問題

$ yum list available 'HOGE*'
Loaded plugins: fastestmirror
Error: File contains no section headers.
file: file:///etc/yum.repos.d/HOGE.repo, line: 2
'<!DOCTYPE html>\n'
  • どうやら、repoの中を覗こうにもhtml形式になってしまっている

期待

  • 下記のように利用できるパッケージをlist形式で見たかった
Available Packages
HOGE.x86_64                          2.28.0-1.el5           HOGE-stable 
HOGE-doc.x86_64                      2.28.0-1.el5           HOGE-stable 
:

解決方法

  • vi /etc/yum.repos.d/HOGE.repo
  • とりあえずviで開いて、問題箇所を手打ちで修正する

原因

  • と viで直ればいいのだが、htmlはそもそもおかしい(正常にlistできるものをviで開けば分かる)
  • この場合、そもそも rep が正しくダウンロードできていない可能性がある。
  • htmlをviで開けば分かるが、404のページを.repoでダウンロードするみたいなことになっている

ので、本当の解決方法

  • もう一度 rep がリンク切れしていないか確認したほうが良い
  • 最悪ソースからbuildする
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?