LoginSignup
29
34

More than 3 years have passed since last update.

WSL版Ubuntuのアップグレード~16.04から18.04へ~

Last updated at Posted at 2018-07-28

概要

Windows Subsystem for Linux(以下WSL)版Ubuntuにて,Ubuntu 16.04からUbuntu 18.04へのアップグレードをした際の記録

謝辞

  • 以下の内容は,あくまでも私の環境で行われたものです.実際にアップグレードをされる際は,自己責任のもとでお願い致します.
  • WSL版 Ubuntu について,呼び名が混合している場合がありますが,ご了承お願い申し上げます.これについては,後日更新する予定です.
  • WSL として配布されている Ubuntu は以下より WSL版 Ubuntu と表記します.
  • 一部,私の知識不足により,使われるべき専門用語が使用されていない場合や誤用されている場合があります.ご了承お願い申し上げるとともに,ご教示を頂ければと思います.
  • Ubuntuの画面上に表示された文字について,一部改行が省略されている場合があります.

背景

WSL版Ubuntuでは,16.04から18.04へのアップグレードの際に,do-release-upgradeを行わなければならないという記事を見たため,18.04.1のリリースに伴い,実際にやってみた.

作業日

2018年7月28日

環境

Windows

windows_version
エディション    Windows 10 Home
バージョン      1803
インストール日  2018/05/03
OS ビルド       17134.191

WSL

Ubuntu(無印版)

バージョンの確認(更新前)

ubuntu_version
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial

作業内容

次の記事を参考にした.
ubuntu 18.04 LTS にアップグレードする(コマンドライン編)

準備

通常のアップデートを行った.

apt_update_and_apt_upgrade
$ sudo apt update && sudo apt upgrade

update-manager-coreの確認

今回,アップグレードを実行した環境では,update-manager-core は既にインストールされており,/etc/update-manager/release-upgrades の設定もすでに Prompt=lts となっていた.

update-manager-core
$ sudo apt-get install update-manager-core  # 既に最新版がインストールされていると表示される.  
$ 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  # Markdownにより,色が変わってしまうため,''に変更している.
#           determine if a newer release is available.
Prompt=lts  ## 初めからPrompt=ltsに設定されていた.

アップグレード

do-release-upgradeの実行

do-release-upgrade
$ sudo do-release-upgrade -d

アップグレードの開始

start_upgrading
Do you want to start the upgrade?  

3 installed packages are no longer supported by Canonical. You can still get support from the community.
3 packages are going to be removed. 84 new packages are going to be installed. 402 packages are going to be upgraded.
You have to download a total of 139 M. This download will take about 9 minutes with your connection.
Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.

Continue [yN]  Details [d]

y を押し,アップグレードを開始させた.後は,特に何もしなくても勝手に作業が行われた.

sshdについて聞かれる

wsl_sshd_config.png

show the differences between the versions を選択すると,バージョンの違いが分かる.
wsl_sshd_config_diff.png

今回は,WSL版Ubuntuをssh-serverとしては使わないため,install the package maintainer's version を選択した.

途中で画面が止まる(アップグレード開始から約30分経過)

lxd
Setting up lxd (3.0.1-0ubuntu1~18.04.1) ...
Installing new version of config file /etc/init.d/lxd ...
Removing obsolete conffile /etc/init/lxd.conf ...
Starting Container hypervisor based on LXC: lxd.

上の状態で画面が一時的に止まるも,その後,特に問題なく継続した.

パッケージの削除(アップグレード開始から約40分経過)

remove_packages
Remove obsolete packages?

31 packages are going to be removed.

 Continue [yN]  Details [d]

特に問題なさそうなため,y を選択した.

アップグレードの終了(パッケージの削除の終了直後)

upgrade_completed
System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] 
=== Command terminated normally (Sat Jul 28 21:00:42 2018) ===

再起動が促されるが,WSL版 Ubuntuでは reboot コマンドが使えないことを考慮し,N を選択し,再起動はしなかった.

Enter を押し,

back_to_bash
Press x to destroy or r to resurrect window # メモし忘れていたので,正しくないかもしれない

上の文を表示させ,x を押して,コマンドラインに戻った.

WSL版 Ubuntuの終了

exit_wsl
$ exit

WSL版 Ubuntuを終了させる.

バージョンの確認(更新後)

ubuntu_version
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

Ubuntu 18.04 へのアップグレードが終了した.

参考文献

ubuntu 18.04 LTS にアップグレードする(コマンドライン編)

変更履歴

2018/07/28 記事の作成
2018/11/11 WSLWSL版 Ubuntu 等の用語の混合を WSL版 Ubuntu に単一化した.
2019/05/08 記事のタグの変更:# を全て削除

29
34
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
29
34