LoginSignup
1
1

More than 1 year has passed since last update.

CentOS7をRocky Linux8にアップグレード

Posted at

0x1 計画と目標

CentOS 7は停止しているため、できるだけ早くRocky Linuxに更新する必要があります。この記事では、Rocky Linuxに安全にアップグレードする方法について説明します。

更新する前に、バックアップを作成してください。

メモリが1GB未満の場合は、仮想メモリを確立する必要があります。

0x2 Rescue Kernel(Black Magic)に切り替えます

cd
yum -y install rsync wget
wget https://raw.githubusercontent.com/johnj/centos-to8-upgrade/master/to8.sh

chmod +x to8.sh
./to8.sh
# エラーが発生した場合、それは問題ではありません
reboot

再起動後、それは特別なRescue Kernelです

0x3 OSアップデート

./to8.sh

# remove temp file
rm -Rf /to8

mkdir -p ~/repo.bak
mv /etc/yum.repos.d/* ~/repo.bak

cat > /etc/yum.repos.d/Rocky-BaseOS.repo <<-EOF
# Rocky-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=Rocky Linux $releasever - BaseOS
baseurl=http://dl.rockylinux.org/vault/rocky/8.4/BaseOS/x86_64/os/
gpgcheck=0
enabled=1
EOF

yum install dnf

dnf -y install nano

cat > /etc/yum.repos.d/Rocky-BaseOS.repo <<-EOF
# Rocky-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Rocky updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=Rocky Linux  - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
#baseurl=http://dl.rockylinux.org/vault/rocky/8.4/BaseOS/x86_64/os/
gpgcheck=0
enabled=1
EOF

dnf -y update
dnf -y upgrade

0x4 Kernelを変更する

dnf -y install epel-release dnf-plugins-core yum-utils
yum-config-manager --set-enabled powertools

dnf -y copr enable rmnscnce/kernel-lqx
dnf -y install kernel-lqx kernel-lqx-devel kernel-lqx-headers 
grub2-mkconfig -o /boot/grub2/grub.cfg

reboot

0x5 仕上げ

たくさんのvpsプロバイダーは古いOSを使用しており、パフォーマンスとセキュリティの両方の理由から最新のものに更新する必要があります。

しかし、CentOSシリーズは扱いが最も難しいOSです。

今後、パフォーマンスとセキュリティに関連するコンテンツを更新する予定ですので、ご期待ください。

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