0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CentOS7.9からCentOS8へアップグレードする方法(2025年2月版)

Last updated at Posted at 2025-02-27

TL;DR

  • CentOS7系からCentOS8系へアップグレードしたい(諸事情でElevateをあえて使わずにRHEL8系へアップグレードしたい)
  • 2025年2月時点でミラーサイトが消えてしまっているため、vault.centos.orgへURLの変更するなど工夫が必要

参考文献

基本的な方法はこちらの記事を参考にして操作します。
https://qiita.com/elect-gombe/items/8ab28fbcaa6aac31424b

違うところ

CentOS7.9からCentOS8へアップグレードに関する記事は、多くが5年前の記事となっており、旧系のCentOSのサポートが終了した今、404エラーなどで正常にパッケージがダウンロードできなくなっている。

レポジトリのURL

dnfでCentOS8系のパッケージを指定する際には、レポジトリなどのURLを現時点でアクセスできるURLに変更する

dnf install -y https://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm}

.repoファイルの変更

CentOS8系のレポジトリをインストール後に、dnfの各レポジトリについても同様にvault.centos.orgへbaseurlを変更する。(mirrorlistはコメント化)

/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
#mirrorlist=・・・
baseurl=https://vault.centos.org/$releasever/BaseOS/$basearch/os/
/etc/yum.repos.d/CentOS-Linux-Extras.repo
#mirrorlist=・・・
baseurl=https://vault.centos.org/$releasever/extras/$basearch/os/
/etc/yum.repos.d/CentOS-Linux-AppStream.repo
#mirrorlist=・・・
baseurl=https://vault.centos.org/$releasever/AppStream/$basearch/os/

アップグレードのコマンド

dnf distro-syncを実行する時にバージョンもCentOS8の最終バージョン(8.5.2111)を指定する

dnf -y --releasever=8.5.2111 --allowerasing --setopt=deltarpm=false distro-sync
dnf -y install kernel-core --releasever=8.5.2111
dnf -y groupupdate "Core" "Minimal Install"  --releasever=8.5.2111

備考

  • すべての環境下でこの方法によってアップグレード可能であるかどうかは検証していません。依存関係によるエラーは起こる可能性があります。
  • 当時から正式なCentOS7からCentOS8へのアップグレードのルートは用意されていません。基本的にはクリーンインストールするか、Elevateを使うべきです。

以上。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?