NaaN日記

やったこと、覚えたことを発信する場

WLSのUbuntu16.04を18.04にした話

はじめに

ずっと、WSLでUbuntu16.04を使っていたので、そろそろ18.04にしようという話。
今後、後輩に18.04を入れさせて、自分は16.04というようなことになったら困るので……。

バージョン確認 (1)

amakuchi@curry:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

現在、16.04であることを確認。

lxdとlxd-clientのパッケージを削除する

WSLでは、systemdがなく、snapによるインストールができない。
そのため、この作業を行わずに do-release-upgrade を行うと、lxdに関連する場所で、タイムアウトまで約10分間待つことになる。

sudo apt purge lxd && sudo apt purge lxd-client

更新

sudo apt update && sudo apt dist-upgrade

/etc/update-manager/release-upgrades の中で、
Prompt=lts
となっていることを確認する。

amakuchi@curry:~$ cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for 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 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 this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.
Prompt=lts

ここで一旦WSLを閉じます。

バージョン確認 (2)

amakuchi@curry:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial

少し新しくなりました。

do-release-upgradeの確認

amakuchi@curry:~$ do-release-upgrade -c
Checking for a new Ubuntu release
New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

'18.04.2' にupgradeできることがわかる。

do-release-upgradeを行う

amakuchi@curry:~$ sudo do-release-upgrade

一回Enterキーを押した後、適所でyを押せばOK

暫く待つと、次のような表示になる。

f:id:CNaan:20190423181048p:plain
ssh-server として使用する予定はないので、
install the package maintainer's version を選択。

引き続き作業が行われる。

※ ここで、lxdのパッケージを削除していなかったら、タイムアウトまで待つことになる

最後に、Restartをするかを聞かれるが、yを押してもWSLの再起動はされない。

その後、Enterキーを押して、

Press x to destroy or r to resurrect window

と出るので、xを押して閉じる。

amakuchi@curry:~$ exit

アップグレードが完了したことの確認

amakuchi@curry:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

できた