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?

WSL2でのUbuntuバージョンアップ

0
Posted at

WSL2上のUbuntuのバージョンを20.04から24.04に上げたので、手順を記載する。

【前提】

  • Powershellでの操作(コマンドプロンプトでもいいかもしれない)

1 . 現在のWS2でのインストール状況確認

> wsl -l -v
  NAME              STATE           VERSION
* Ubuntu-20.04      Running         2
  docker-desktop    Running         2

2 . インストールしたいバージョンのUbuntuをインストール

> wsl --install -d Ubuntu-24.04
インストール中: Ubuntu 24.04 LTS
Ubuntu 24.04 LTS がインストールされました。
(以下略)

3 . アカウントの作成

Enter new UNIX username: ユーザ名
New password: パスワード

4 . Ubuntuから抜ける

~$ exit

5 . 現在のWS2でのインストール状況確認

> wsl -l -v
  NAME              STATE           VERSION
* Ubuntu-20.04      Running         2
  Ubuntu-24.04      Running         2
  docker-desktop    Running         2

6 . WSL2のデフォルトのUbuntuバージョン切り替え

> wsl --set-default Ubuntu-24.04
この操作を正しく終了しました。

7 . WSL2のデフォルトのバージョン確認

> wsl -l -v
  NAME              STATE           VERSION
* Ubuntu-24.04      Running         2
  docker-desktop    Running         2
  Ubuntu-20.04      Running         2

8 . 古いバージョンのUbuntuをアンインストール(登録解除)

> wsl --unregister Ubuntu-20.04
登録解除。
この操作を正しく終了しました。

9 . 現在のWS2でのインストール状況確認

> wsl -l -v
  NAME              STATE           VERSION
* Ubuntu-24.04      Running         2
  docker-desktop    Running         2

以下はVSCode使いたい人

10 . インストールしたUbuntuを開く
11 . 以下のコマンドを叩くとバージョンアップした方のUbuntuでVSCodeが開ける

~$ code .
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?