最終更新日:2023年8月23日

ubuntu lts をアップグレードする方法

記事内に商品プロモーションを含む場合があります。

はじめに

今回は、ubuntu ltsのバージョンを20.04.6 LTS (Focal Fossa)から22.04.3 LTS (Jammy Jellyfish)にアップグレードします。
環境はWindows10のWSL2です。

現在のバージョンを確認

/etc/os-releaseを見れば現在のバージョン情報がわかります。

$ cat /etc/os-release

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

パッケージのアップデート

$ sudo apt update && sudo apt upgrade

アップグレードに必要なパッケージのインストール

$ sudo apt dist-upgrade && sudo apt install update-manager-core

アップグレードマネージャの設定

最終行がPrompt=ltsになっていることを確認。

$ sudo cat /etc/update-manager/release-upgrades

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting and upgrade behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
Prompt=lts

アップグレードの実行

$ sudo do-release-upgrade -d

何度か確認のプロンプトが出るので[y]をタイプしていく。

完了確認

新しいバージョンに変わっていれば成功です。

$ cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

おすすめ

ubuntu lts をアップグレードする方法の商品をアマゾンで調べる。
Pythonでlibssl.so.1.1がインポートエラー
sect: Pythons | lastmod: 2023-08-23 | pv: 37
WSLでVSCODEを起動しようとしたら「Segmentation fault」
sect: Windows | lastmod: 2023-07-31 | pv: 132
ubuntu20.04LTSでapt-get install しているとdebconf: delaying package configuration, since apt-utils is not installedという警告が表示される
sect: Teches | lastmod: 2025-08-18 | pv: 2713
ubuntu20.04LTSにjreをインストールしようとしたらGeographic areaの入力を求められる
sect: Teches | lastmod: 2020-11-18 | pv: 49
ubuntuのバージョンをコマンドで調べる方法
sect: Teches | lastmod: 2020-10-21 | pv: 4