LoginSignup
8
7

More than 3 years have passed since last update.

CentOS 8.0 でパッケージがインストールできなくなったら

Last updated at Posted at 2020-02-11

CentOS 8.0 で rpm パッケージをアップデートすると、OS バージョンを表す DNF 変数 $releasever が 8 から 8.0 に変わり、DNF リポジトリの URL にアクセスできなくなり、パッケージをインストールできなくなってしまうようです。

# dnf -y install httpd
Error: This command has to be run under the root user.
CentOS-8.0 - AppStream                           26  B/s |  38  B     00:01
CentOS-8.0 - Base                                22  B/s |  38  B     00:01
CentOS-8.0 - Extras                              14  B/s |  38  B     00:02
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Failed to synchronize cache for repo 'extras', ignoring this repo.
No match for argument: httpd
Error: Unable to find a match

この問題は dnf パッケージをアップデートすれば解消しますが、そのままではインストールと同じくアップデートもできないので、--releasever オプションで OS バージョンを指定する必要があります。

# dnf --releasever=8 -y update dnf
(省略)
Upgraded:
  dnf-4.2.7-7.el8_1.noarch
  dnf-data-4.2.7-7.el8_1.noarch
  dnf-plugins-core-4.0.8-3.el8.noarch
  libdnf-0.35.1-9.el8_1.x86_64
  librepo-1.10.3-3.el8.x86_64
  libsolv-0.7.4-3.el8.x86_64
  python3-dnf-4.2.7-7.el8_1.noarch
  python3-dnf-plugins-core-4.0.8-3.el8.noarch
  python3-hawkey-0.35.1-9.el8_1.x86_64
  python3-libdnf-0.35.1-9.el8_1.x86_64
  python3-librepo-1.10.3-3.el8.x86_64
  yum-4.2.7-7.el8_1.noarch

Installed:
  yum-utils-4.0.8-3.el8.noarch

Complete!

これでパッケージをインストールできるようになります。

8
7
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
8
7