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?

EOLでサポートが切れたUbuntuをLTSにする

0
Posted at

概要

最初にUbuntuを設定した時、間違えてLTSでないバージョンでセットアップしてしまうと、半年ぐらいしてサポート期限が切れ、何も更新できなくなってしまうということがある。今回はそれを怒った時にLTSに設定し直す方法を記載する。

環境

元 ver 23.何か。
目的 ver 24.0.4.3 LTS

実装方法

まず、以下のファイルを編集する。

etc/update-manager/release-upgrades

そして、Prompt=normalになていることを確認する。ドキュメントでは

sudo perl -pi -e 's/^Prompt=.*/Prompt=normal/' /etc/update-manager/release-upgrades

らしい。
その後、リポジトリを変更する。

sudo nano /etc/apt/sources.list

以下の内容に修正する。
中のすべてのURLを、以下の内容に置き換えてください。

deb http://old-releases.ubuntu.com/ubuntu/ mantic main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ mantic-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ mantic-backports main restricted universe multiverse

その後、以下のコマンドでまずアップデートを実行する。
これでおそらく、元のバージョンが更新できるメジャーバージョンの最新になっているはずである。

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove

その後、以下のコマンドを実行する。これにより、現状のLTSの最新版にアップデートされる。もしかしたら、-d は不要になるかもしれない。試してみること。

sudo apt install update-manager-core
sudo do-release-upgrade -d

IMG_6523.jpeg

その後、cat /etc/os-releaseなどを実行してバージョンを確認すると、アップデートされていることを確認できる。

C675A0FE-D2F1-4075-8E62-89CCC5710FD7_1_105_c.jpeg

余談

アップデートをしない状態でdo-release-upgradeを実行しても、
バージョンのUbuntuサポートが切られてるというエラーメッセージが表示されアップデートできない。

参考

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?