虎之助の徒然記

サポート外となった17.04のLubuntuを18.04へアップデートした

【概要】
 サポート切れとなった17.04のlubuntuを18.04へアップグレードしました。基本的にはレポジトリの変更だけで、アップグレードできますので、難しい作業ではありませんでした。

1. いつの間にかサポート期限を過ぎていた

 HDD/SSDへの換装に当たって、久しぶりにLubuntuをインストールしたHP miniを起動しました。gdiskを入れていなかったので、apt-getでインストールしようとしたら、既にOSのバージョンが古くて、リポジトリがなくなっていました。

 入れていたOSのバージョンは、lubuntu17.04。LTSでない通常版のサポート期間は、9か月なので、2018年9月時点では、既にサポート対象期限を過ぎています。

 LTS (Long Term Support) は、サポート期間が5年間。たまにしか使わないマシンにはLTS版を入れるべきでした。

2. 17.04から18.04へのバージョンアップ

 以下の記事を参考に、バージョンアップを行いました。

Ubuntu 最新バージョンへのアップグレード - eTuts+ Server Tutorial

 この記事の「次へ進む前に軽く一読 : アップグレード可能と言ってるのに、アップグレードしようとするとアップグレード出来ないと怒られる」の説明と同様に、do-release-upgradeは拒否されました。

 A(17.04)→C(18.04)にバージョンアップしたいのだけど、A(17.04)のdo-release-upgradeは、A→B(17.10)のアップグレードしかサポートしない。だから、いきなり18.04へのアップグレードはできないということのようです。

 この記事の「歯抜け状態でのアップグレード その1. sources.list を書き換えて、A → B → C へ」の説明と同様に、/etc/apt/sources.list を編集することで、A(17.04) から B(17.10) に dist-upgrade したうえで、B(17.10) からC(18.04) に do-release-upgrade しました。

 具体的な作業は以下の通りです。

  • /etc/apt/sources.listを編集する。
    • "zesty"(17.04)をすべて "artful"(17.10) に置き換える。
  • sudo dist-upgrade を実行する。
    • この時点でリリースは、17.10となる
  • sudo do-release-upgrade を実行する
    • この結果、18.04になる
  • sudo reboot

 以上で、18.04へのアップグレードは完了です。レポジトリの変更だけで解決しました。

3. 最後に

 あまり使わないマシンにはLTS版を入れるべし。

(2018/9/20)

関連記事

付録:zestyをartfulに書換え後の/etc/apt/sources.list

 zestyをartfulに機械的に置き換えて構いません。

# deb cdrom:[Lubuntu 17.04 _Zesty Zapus_ - Release i386 (20170412)]/ zesty main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu artful main restricted
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu artful-updates main restricted
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu artful universe
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful universe
deb http://archive.ubuntu.com/ubuntu artful-updates universe
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu artful multiverse
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://archive.ubuntu.com/ubuntu artful-updates multiverse
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
# deb-src http://jp.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu artful partner
# deb-src http://archive.canonical.com/ubuntu artful partner

deb http://archive.ubuntu.com/ubuntu artful-security main restricted
# deb-src http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://archive.ubuntu.com/ubuntu artful-security universe
# deb-src http://security.ubuntu.com/ubuntu artful-security universe
deb http://archive.ubuntu.com/ubuntu artful-security multiverse
# deb-src http://security.ubuntu.com/ubuntu artful-security multiverse

http://archive.ubuntu.com でファイルが見つからない場合には、http://old-releases.ubuntu.com に変更すれば、更新できると思います。

 なお、ダウンロード元は「日本のサーバー」にしていましたが、「メインサーバー」に切り替えて作業しました。

f:id:toranosuke_blog:20180826212245p:plain:w500
日本のサーバーでもできるかは、よく分かりません。