1
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?

More than 1 year has passed since last update.

PCセッティング覚書(WSL2)

Last updated at Posted at 2022-12-15

新規購入したPCにWSL2を設定した覚書

新しく買ったWindows 11のPCにWSL2を設定した自分用メモ。

PowerShell 7

PowerShellを起動したら

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

新機能と改善のために最新の PowerShell をインストールしてください!https://aka.ms/PSWindows

なんて出るもんだから、とりあえずPowerShellをアップデートしてみる。

Wingetによるインストールが推奨なので、それに従って実行。

winget search Microsoft.PowerShell
'msstore' ソースを使用するには、使用する前に次の契約を表示する必要があります。
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
ソースが正常に機能するには、現在のマシンの 2 文字の地理的リージョンをバックエンド サービスに送信する必要があります (: "US")
すべてのソース契約条件に同意しますか?
[Y] はい  [N] いいえ:

ストアに関する同意が必要らしい。リンク先を確認の上許諾。

名前       ID                           バージョン ソース
----------------------------------------------------------
PowerShell Microsoft.PowerShell         7.3.1.0    winget
PowerShell Microsoft.PowerShell.Preview 7.3.101.0  winget

無印版をインストールすることにする。

winget install --id Microsoft.Powershell --source winget
見つかりました PowerShell [Microsoft.PowerShell] バージョン 7.3.1.0
このアプリケーションは所有者からライセンス供与されます。
Microsoft はサードパーティのパッケージに対して責任を負わず、ライセンスも付与しません。
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/PowerShell-7.3.1-win-x64.msi
  ██████████████████████████████   101 MB /  101 MB
インストーラーハッシュが正常に検証されました
パッケージのインストールを開始しています...
インストールが完了しました

インストールの完了。以降はPowerShell 7で作業していく。
PowerShell 7を管理者として実行(Run as Administrator)。

WSL2

コマンド一行打つだけらしい。

wsl --install
インストール中: Linux  Windows サブシステム
Linux  Windows サブシステム はインストールされました。
インストール中: Ubuntu
Ubuntu はインストールされました。
要求された操作は正常に終了しました。変更を有効にするには、システムを再起動する必要があります。

再起動が必要らしいので、素直に再起動する。

image.png

Ubuntuの画面が出た。ユーザ名とパスワードを聞かれるので登録。

とりあえずUbuntuのアップデートもしておく。

sudo apt update && sudo apt upgrade

image.png

スタートメニューに追加されており、ここから起動できているので、セットアップはできた感じ。
実際の使用に関してはまた別途。

1
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
1
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?