Ubuntu 18 を Ubuntu 20 にアップグレードする
説明
この記事では、OS を Ubuntu 18.04 から Ubuntu 20.04 にアップグレードする手順について説明します。
アップグレード
警告
オペレーティングシステムをアップグレードする前に、サーバー上のすべてのデータの完全バックアップを作成することを強く推奨します。 これにより、問題が発生した場合の保険となり、緊急時にシステムを復元できます。
重要
OS のアップグレード中のすべてのコマンドは、root ユーザーでサーバーターミナル上から実行します。
設定ファイルを置き換えるというシステムの提案は拒否してください(デフォルトの動作)。
お使いの OS の /etc/apt/sources.list.d 内のリポジトリファイル名は、この手順で使用されているものと異なる場合があります。
/etc/apt/sources.listに正しいリポジトリがあることを確認してください。 Ubuntu 18.04 のリポジトリ一覧は以下で確認できます。
Ubuntu 18 のリポジトリ
### Main repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
### Updates repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
### Security repo for Ubuntu bionic
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
### Backports repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
### Proposed repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
- 現在のすべてのパッケージを最新バージョンに更新します
apt update && apt dist-upgrade
- proftpd および apache2 のアップグレード時に発生する可能性のあるエラーを解消する
a2dismod php7.2
sed -e 's/^IdentLookups/#IdentLookups/' -i /etc/proftpd/proftpd.conf
- mysql の設定からすべての query-cache エントリを削除し、mysql リポジトリを調整する:
sed -i 's/^query[_,-]cache[^ ]*//' /etc/mysql/my.cnf.fastpanel/99-fastpanel.cnf
- 更新を実行します
do-release-upgrade --allow-third-party
何らかの理由でユーティリティがインストールされていない場合は、次のコマンドで修正できます
apt install update-manager-core
重要